#48019 [NEW]: Problem with
| From: | pulni4kiya at abv dot bg | Date: | Sun, 19 Apr 2009 22:50:10 +0000 |
| Subject: | #48019 [NEW]: Problem with | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-135989@lists.php.net to get a copy of this message | ||
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