#30146 [Opn->Csd]: ReflectionProperty->getValue() requires instance for static property

From: Date: Sun, 19 Sep 2004 11:55:34 +0000
Subject: #30146 [Opn->Csd]: ReflectionProperty->getValue() requires instance for static property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66409@lists.php.net to get a copy of this message
ID: 30146 Updated by: helly@php.net Reported By: cellog@php.net -Status: Open +Status: Closed Bug Type: Class/Object related Operating System: * -PHP Version: 5.0.1 +PHP Version: 5.0.* Assigned To: helly 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. Fixed in 5.1-dev, we probably MFH it after 5.0.2 is out. Previous Comments: ------------------------------------------------------------------------ [2004-09-19 00:26:18] cellog@php.net Description: ------------ When calling ReflectionProperty->getValue() on a public static property, getValue() requires an object instance to be passed in, even though this doesn't matter for static public properties. It would be nice if null could be passed in addition to an instance. Reproduce code: --------------- <?php class test { static public $a = 1; } $refl = new ReflectionProperty('test', 'a'); echo $refl->getValue(null); Expected result: ---------------- 1 Actual result: -------------- Warning: getValue() expects parameter 1 to be object, null given in Command line code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30146&edit=1

« previous php.bugs (#66409) next »