|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46064 Exception when creating ReflectionProperty object on dynamicly created property
Submitted: 2008-09-12 11:16 UTC Modified: 2013-09-12 16:51 UTC
From: zemi dot inet at gmail dot com Assigned: felipe (profile)
Status: Closed Package: Reflection related
PHP Version: 5.2.6 OS: Linux amoeba 2.6.22-14-server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: zemi dot inet at gmail dot com
New email:
PHP Version: OS:


 [2008-09-12 11:16 UTC] zemi dot inet at gmail dot com
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');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-29 15:06 UTC]
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
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.
 [2013-09-12 16:51 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 05:03:34 2021 UTC