1--TEST-- 2Bug #46064.2 (Exception when creating ReflectionProperty object on dynamicly created property) 3--FILE-- 4<?php 5 6class foo { 7} 8 9$x = new foo; 10$x->test = 2000; 11 12 13$p = new ReflectionObject($x); 14var_dump($p->getProperty('test')); 15 16 17class bar { 18 public function __construct() { 19 $this->a = 1; 20 } 21} 22 23class 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 36new test; 37 38?> 39--EXPECTF-- 40object(ReflectionProperty)#%d (2) { 41 ["name"]=> 42 string(4) "test" 43 ["class"]=> 44 string(3) "foo" 45} 46object(ReflectionProperty)#%d (2) { 47 ["name"]=> 48 string(1) "a" 49 ["class"]=> 50 string(4) "test" 51} 52bool(false) 53bool(false) 54bool(false) 55bool(true) 56bool(false) 57array(2) { 58 [0]=> 59 object(ReflectionProperty)#%d (2) { 60 ["name"]=> 61 string(1) "b" 62 ["class"]=> 63 string(4) "test" 64 } 65 [1]=> 66 object(ReflectionProperty)#%d (2) { 67 ["name"]=> 68 string(1) "a" 69 ["class"]=> 70 string(4) "test" 71 } 72} 73