|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40431 ReflectionProperty::isStatic() returns true for overloaded properties
Submitted: 2007-02-10 15:09 UTC Modified: 2007-02-10 20:52 UTC
From: bugs at forestfactory dot de Assigned: tony2001 (profile)
Status: Closed Package: Class/Object related
PHP Version: 4CVS-2007-02-10 (CVS) OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 + 8 = ?
Subscribe to this entry?

 [2007-02-10 15:09 UTC] bugs at forestfactory dot de
For stdClass objects, ReflectionProperty::isStatic() returns true for all properties.

Code has two examples, the first one showing the bug, the second one showing the expected result.

Reproduce code:
// Creating Obj with "new" doesn't affect this bug
/* $Obj = new stdClass; */
$Obj->value = 'value';
$RefObj = new ReflectionObject($Obj);
foreach ($RefObj->getProperties() as $Property) {
  var_dump($Property->isStatic()); // prints "bool(true)"

// Reflection works for this class
class myClass extends stdClass {

$MyObj = new myClass;
$MyObj->value = 'value';
$RefObj = new ReflectionObject($MyObj);
foreach ($RefObj->getProperties() as $Property) {
  var_dump($Property->isStatic()); // prints "bool(false)"

Expected result:
both var_dump's should print "bool(false)"

Actual result:
stdClass::$value is said to be static


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-10 20:52 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.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 18:01:33 2024 UTC