|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-10 20:52 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 02:00:01 2025 UTC |
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