#33822 [NEW]: Error : Only variables can be passed by reference

From: Date: Fri, 22 Jul 2005 13:00:05 +0000
Subject: #33822 [NEW]: Error : Only variables can be passed by reference
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82322@lists.php.net to get a copy of this message
From: stochnagara at hotmail dot com Operating system: Windows XP PHP version: 5CVS-2005-07-22 (dev) PHP Bug Type: Scripting Engine problem Bug description: Error : Only variables can be passed by reference Description: ------------ A strange bug with references is present in today's snaphshot (10:30) of PHP 5.1. I call it bug because many old PHP scripts don't work anymore. The problem is that passing an argument to a function expecting a reference when this argument retreived by another function call, causes a Fatal Error. With PHP 5.0.4 it works fine. Reproduce code: --------------- <? function a (&$str) { echo 'hi'; } function b ($str) { return $str . 'hi'; } echo a (b('1')); Expected result: ---------------- hi Actual result: -------------- Fatal error: Only variables can be passed by reference in C:\Program Files\Apache Group\...\test.php on line 11 -- Edit bug report at http://bugs.php.net/?id=33822&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33822&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33822&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33822&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33822&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33822&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33822&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33822&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33822&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33822&r=support Expected behavior: http://bugs.php.net/fix.php?id=33822&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33822&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33822&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33822&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33822&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33822&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33822&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33822&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33822&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33822&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33822&r=mysqlcfg

« previous php.bugs (#82322) next »