#46064 [Opn->Asn]: Exception when creating ReflectionProperty object on dynamicly created property

From: Date: Wed, 29 Oct 2008 00:31:21 +0000
Subject: #46064 [Opn->Asn]: Exception when creating ReflectionProperty object on dynamicly created property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-130262@lists.php.net to get a copy of this message
ID: 46064 Updated by: felipe@php.net Reported By: zemi dot inet at gmail dot com -Status: Open +Status: Assigned Bug Type: Reflection related Operating System: Linux amoeba 2.6.22-14-server PHP Version: 5.2.6 -Assigned To: +Assigned To: felipe Previous Comments: ------------------------------------------------------------------------ [2008-09-12 13:42:30] zemi dot inet at gmail dot com more meaningful summary ------------------------------------------------------------------------ [2008-09-12 11:16:08] zemi dot inet at gmail dot com Description: ------------ Always getting exception when creating ReflectionProperty object on dynamicly created property. Discovered when I tried to use ReflectionProperty::isDefault(). I presume it returns true when property is created on compile-time and false when dynamicly created on run-time? Reproduce code: --------------- class x { public $x = 1; public $y = 1; } $o = new x; $o->z = 1; $reflector = new ReflectionProperty($o, 'z'); $d = $reflector->isDefault(); Expected result: ---------------- $d == false Actual result: -------------- Fatal error: Uncaught exception 'ReflectionException' with message 'Property x::$z does not exist' on line: $reflector = new ReflectionProperty($o, 'z'); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46064&edit=1

« previous php.bugs (#130262) next »