|  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
Status: Closed Package: Class/Object related
PHP Version: 4CVS-2007-02-10 (CVS) OS: Windows XP SP2
Private report: No CVE-ID:
 [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-2015 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 17:01:32 2015 UTC