#24745 [NEW]: return ($val) is broken for references

From: Date: Tue, 22 Jul 2003 00:48:06 +0000
Subject: #24745 [NEW]: return ($val) is broken for references
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-44463@lists.php.net to get a copy of this message
From: vma1 at abv dot bg Operating system: Slackware Linux 9.0 PHP version: 5CVS-2003-07-21 (dev) PHP Bug Type: Zend Engine 2 problem Bug description: return ($val) is broken for references Description: ------------ "return ($val);" does not work in a function that returns a reference. "return $val;" is OK. Reproduce code: --------------- class lala { var $val; function lala () { $this->val = 0; } function &get_val () { $inf = 88; $this->val = $inf; return ($inf); } } $obj = new lala; $vvv = &$obj->get_val (); Actual result: -------------- Fatal error: Only variables or references can be returned by reference in /usr/local/apache/site/htdocs/bug.php on line 15 -- Edit bug report at http://bugs.php.net/?id=24745&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24745&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24745&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24745&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24745&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24745&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24745&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24745&r=support Expected behavior: http://bugs.php.net/fix.php?id=24745&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24745&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24745&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24745&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24745&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24745&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24745&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24745&r=gnused

« previous php.bugs (#44463) next »