#40431 [Asn->Csd]: ReflectionProperty::isStatic() returns true for overloaded properties

From: Date: Sat, 10 Feb 2007 20:52:45 +0000
Subject: #40431 [Asn->Csd]: ReflectionProperty::isStatic() returns true for overloaded properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108682@lists.php.net to get a copy of this message
ID: 40431 Updated by: tony2001@php.net Reported By: bugs at forestfactory dot de -Status: Assigned +Status: Closed Bug Type: Class/Object related Operating System: Windows XP SP2 PHP Version: 4CVS-2007-02-10 (CVS) Assigned To: tony2001 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2007-02-10 15:09:02] bugs at forestfactory dot de Description: ------------ 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: --------------- <?php // 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40431&edit=1

« previous php.bugs (#108682) next »