Annotation of embedaddon/php/ext/reflection/tests/bug46064_2.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #46064.2 (Exception when creating ReflectionProperty object on dynamicly created property)
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: class foo { 
        !             7: }
        !             8: 
        !             9: $x = new foo;
        !            10: $x->test = 2000;
        !            11: 
        !            12: 
        !            13: $p = new ReflectionObject($x);
        !            14: var_dump($p->getProperty('test'));
        !            15: 
        !            16: 
        !            17: class bar {
        !            18:        public function __construct() {
        !            19:                $this->a = 1;
        !            20:        }
        !            21: }
        !            22: 
        !            23: class test extends bar {
        !            24:        private $b = 2;
        !            25: 
        !            26:        public function __construct() {
        !            27:                parent::__construct();
        !            28:                
        !            29:                $p = new reflectionobject($this);
        !            30:                var_dump($h = $p->getProperty('a'));
        !            31:                var_dump($h->isDefault(), $h->isProtected(), $h->isPrivate(), $h->isPublic(), $h->isStatic());
        !            32:                var_dump($p->getProperties());
        !            33:        }
        !            34: }
        !            35: 
        !            36: new test;
        !            37: 
        !            38: ?>
        !            39: ===DONE===
        !            40: --EXPECTF--
        !            41: object(ReflectionProperty)#%d (2) {
        !            42:   ["name"]=>
        !            43:   string(4) "test"
        !            44:   ["class"]=>
        !            45:   string(3) "foo"
        !            46: }
        !            47: object(ReflectionProperty)#%d (2) {
        !            48:   ["name"]=>
        !            49:   string(1) "a"
        !            50:   ["class"]=>
        !            51:   string(4) "test"
        !            52: }
        !            53: bool(false)
        !            54: bool(false)
        !            55: bool(false)
        !            56: bool(true)
        !            57: bool(false)
        !            58: array(2) {
        !            59:   [0]=>
        !            60:   &object(ReflectionProperty)#%d (2) {
        !            61:     ["name"]=>
        !            62:     string(1) "b"
        !            63:     ["class"]=>
        !            64:     string(4) "test"
        !            65:   }
        !            66:   [1]=>
        !            67:   &object(ReflectionProperty)#%d (2) {
        !            68:     ["name"]=>
        !            69:     string(1) "a"
        !            70:     ["class"]=>
        !            71:     string(4) "test"
        !            72:   }
        !            73: }
        !            74: ===DONE===

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