Annotation of embedaddon/php/Zend/tests/bug45862.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #45862 (get_class_vars is inconsistent with 'protected' and 'private' variables)
                      3: --FILE--
                      4: <?php
                      5: 
                      6: class Ancestor {
                      7:   function test() {
                      8:     var_dump(get_class_vars("Tester"));
                      9:     var_dump(Tester::$prot);
                     10:   }
                     11: }
                     12: 
                     13: class Tester extends Ancestor {
                     14:   static protected $prot = "protected var";
                     15:   static private $priv = "private var";
                     16: }
                     17: 
                     18: class Child extends Tester {
                     19:   function test() { var_dump(get_class_vars("Tester")); }
                     20: }
                     21: 
                     22: echo "\n From parent scope\n";
                     23: $parent = new Ancestor();
                     24: $parent->test();
                     25: echo "\n From child scope\n";
                     26: $child = new Child();
                     27: $child->test();
                     28: 
                     29: ?>
                     30: --EXPECT--
                     31: 
                     32:  From parent scope
                     33: array(1) {
                     34:   ["prot"]=>
                     35:   string(13) "protected var"
                     36: }
                     37: string(13) "protected var"
                     38: 
                     39:  From child scope
                     40: array(1) {
                     41:   ["prot"]=>
                     42:   string(13) "protected var"
                     43: }

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