#34468 [NEW]: Fatal error for current

From: Date: Sun, 11 Sep 2005 21:35:17 +0000
Subject: #34468 [NEW]: Fatal error for current
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84876@lists.php.net to get a copy of this message
From: j dot gizmo at aon dot at Operating system: Windows 2000 Server PHP version: 5.0.5 PHP Bug Type: Reproducible crash Bug description: Fatal error for current Description: ------------ current() only works on variables; no longer on arrays returned from functions. This also explains Bug #34424, which has been classified as Bogus. Reproduce code: --------------- $x = current(explode(' ','a b')); echo $x; Expected result: ---------------- a Actual result: -------------- Fatal error: Only variables can be passed by reference in ... -------------- However, the following DOES work as expected: $a = current($x=&explode(" ","a b")); This new behaviour breaks backward compatibility. Furthermore, it introduces continuity problems. In both cases, an array is passed to current(), only one time it is stored in a variable and the other time it isn't. This should not make a difference, because even a "temporary array" should have a current element. -- Edit bug report at http://bugs.php.net/?id=34468&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34468&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34468&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34468&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34468&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34468&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34468&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34468&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34468&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34468&r=support Expected behavior: http://bugs.php.net/fix.php?id=34468&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34468&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34468&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34468&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34468&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34468&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34468&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34468&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34468&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34468&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34468&r=mysqlcfg

« previous php.bugs (#84876) next »