Bug #46064 [Opn->Csd]: Exception when creating ReflectionProperty object on dynamicly created property
| From: | felipe@php.net | Date: | Thu, 12 Sep 2013 16:51:09 +0000 |
| Subject: | Bug #46064 [Opn->Csd]: Exception when creating ReflectionProperty object on dynamicly created property | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181553@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=46064&edit=1
ID: 46064
Updated by: felipe@php.net
Reported by: zemi dot inet at gmail dot com
Summary: Exception when creating ReflectionProperty object on
dynamicly created property
-Status: Open
+Status: Closed
Type: Bug
Package: Reflection related
Operating System: Linux amoeba 2.6.22-14-server
PHP Version: 5.2.6
-Assigned To:
+Assigned To: felipe
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2008-10-29 15:06:29] felipe@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
We need add some examples for this case. The tests added with the patch can help.
http://news.php.net/php.cvs/53766
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=46064&edit=1