ID: 40431 Updated by: [EMAIL PROTECTED] Reported By: bugs at forestfactory dot de -Status: Open +Status: Assigned Bug Type: Class/Object related Operating System: Windows XP SP2 PHP Version: 4CVS-2007-02-10 (CVS) -Assigned To: +Assigned To: tony2001
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