Annotation of embedaddon/php/tests/output/ob_start_basic_006.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
1.1.1.2 ! misho       2: ob_start(): ensure multiple buffer initialization with a single call using arrays is not supported on PHP6 (http://bugs.php.net/42641)
1.1       misho       3: --FILE--
                      4: <?php
                      5: /* 
                      6:  * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
                      7:  * Function is implemented in main/output.c
                      8: */ 
                      9: 
                     10: function f($string) {
                     11:        static $i=0;
                     12:        $i++;
                     13:        $len = strlen($string);
                     14:        return "f[call:$i; len:$len] - $string\n";
                     15: }
                     16: 
                     17: Class C {
                     18:        public $id = 'none';
                     19: 
                     20:        function __construct($id) {
                     21:                $this->id = $id;
                     22:        }
                     23: 
                     24:        static function g($string) {
                     25:                static $i=0;
                     26:                $i++;
                     27:                $len = strlen($string);
                     28:                return "C::g[call:$i; len:$len] - $string\n";
                     29:        }
                     30:        
                     31:        function h($string) {
                     32:                static $i=0;
                     33:                $i++;
                     34:                $len = strlen($string);
                     35:                return "C::h[call:$i; len:$len; id:$this->id] - $string\n";
                     36:        }
                     37: }
                     38: 
                     39: function checkAndClean() {
                     40:   print_r(ob_list_handlers());
                     41:   while (ob_get_level()>0) {
                     42:     ob_end_flush();
                     43:   }
                     44: }
                     45: 
                     46: echo "\n ---> Test arrays: \n";
                     47: var_dump(ob_start(array("f")));
                     48: checkAndClean();
                     49: 
                     50: var_dump(ob_start(array("f", "f")));
                     51: checkAndClean();
                     52: 
                     53: var_dump(ob_start(array("f", "C::g", "f", "C::g")));
                     54: checkAndClean();
                     55: 
                     56: var_dump(ob_start(array("f", "non_existent", "f")));
                     57: checkAndClean();
                     58: 
                     59: var_dump(ob_start(array("f", "non_existent", "f", "f")));
                     60: checkAndClean();
                     61: 
                     62: $c = new c('originalID');
                     63: var_dump(ob_start(array($c, "h")));
                     64: checkAndClean();
                     65: 
                     66: var_dump(ob_start(array($c, "h")));
                     67: $c->id = 'changedID';
                     68: checkAndClean();
                     69: 
                     70: $c->id = 'changedIDagain';
                     71: var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h")))));
                     72: checkAndClean();
                     73: ?>
                     74: --EXPECTF--
                     75:  ---> Test arrays: 
1.1.1.2 ! misho      76: 
        !            77: Warning: ob_start(): array must have exactly two members in %s on line 44
        !            78: 
        !            79: Notice: ob_start(): failed to create buffer in %s on line 44
        !            80: bool(false)
1.1       misho      81: Array
                     82: (
                     83: )
                     84: 
1.1.1.2 ! misho      85: Warning: ob_start(): class 'f' not found in %s on line 47
        !            86: 
        !            87: Notice: ob_start(): failed to create buffer in %s on line 47
        !            88: bool(false)
1.1       misho      89: Array
                     90: (
                     91: )
                     92: 
1.1.1.2 ! misho      93: Warning: ob_start(): array must have exactly two members in %s on line 50
1.1       misho      94: 
1.1.1.2 ! misho      95: Notice: ob_start(): failed to create buffer in %s on line 50
        !            96: bool(false)
1.1       misho      97: Array
                     98: (
                     99: )
                    100: 
1.1.1.2 ! misho     101: Warning: ob_start(): array must have exactly two members in %s on line 53
1.1       misho     102: 
1.1.1.2 ! misho     103: Notice: ob_start(): failed to create buffer in %s on line 53
        !           104: bool(false)
1.1       misho     105: Array
                    106: (
                    107: )
                    108: 
1.1.1.2 ! misho     109: Warning: ob_start(): array must have exactly two members in %s on line 56
        !           110: 
        !           111: Notice: ob_start(): failed to create buffer in %s on line 56
        !           112: bool(false)
1.1       misho     113: Array
                    114: (
                    115: )
                    116: C::h[call:1; len:37; id:originalID] - bool(true)
                    117: Array
                    118: (
                    119:     [0] => C::h
                    120: )
                    121: 
                    122: C::h[call:2; len:37; id:changedID] - bool(true)
                    123: Array
                    124: (
                    125:     [0] => C::h
                    126: )
                    127: 
1.1.1.2 ! misho     128: 
        !           129: Warning: ob_start(): array must have exactly two members in %s on line 68
        !           130: 
        !           131: Notice: ob_start(): failed to create buffer in %s on line 68
        !           132: bool(false)
1.1       misho     133: Array
                    134: (
1.1.1.2 ! misho     135: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>