From: pulni4kiya at abv dot bg Operating system: PHP version: 5.2.9 PHP Bug Type: Reflection related Bug description: Problem with
Description:
------------
The problem is that ReflectionMethod's invoke() method does not return
reference (when it should)! Neither does call_user_func() for that matter.
Reproduce code:
---------------
class A {
public static $c = 100;
public static function &D() {
return self::$c;
}
}
echo A::$c; //prints 100
$cRef1 =& A::D();
$cRef1 = 200;
echo A::$c; //prints 200
$a = new ReflectionClass('A');
$d = $a->getMethod('D');
$cRef2 =& $d->invoke(null); //DOES NOT RETURN REFERENCE!!!
$cRef2 = 300;
echo A::$c; //prints 200
Expected result:
----------------
100200300
Actual result:
--------------
100200200
--
Edit bug report at http://bugs.php.net/?id=48019&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48019&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48019&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48019&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48019&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48019&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48019&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48019&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48019&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48019&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48019&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48019&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48019&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48019&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48019&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48019&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48019&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48019&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48019&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48019&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48019&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48019&r=mysqlcfg
