File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug45862.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    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>