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

From: Date: Sat, 10 Feb 2007 19:49:43 +0000
Subject: #40431 [Opn->Asn]: ReflectionProperty::isStatic() returns true for overloaded properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108680@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: 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

« previous php.bugs (#108680) next »