From:             [EMAIL PROTECTED]
Operating system: windows XP
PHP version:      5.0.1
PHP Bug Type:     Class/Object related
Bug description:  ReflectionProperty->getValue() requires instance for static property

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 bug report at http://bugs.php.net/?id=30146&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30146&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30146&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30146&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30146&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30146&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30146&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30146&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30146&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30146&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30146&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30146&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30146&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30146&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30146&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30146&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30146&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30146&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30146&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30146&r=mysqlcfg

Reply via email to