#34244 [NEW]: The array_pop()-function doesn't take immediate arrays (like explode())

From: Date: Thu, 25 Aug 2005 00:58:29 +0000
Subject: #34244 [NEW]: The array_pop()-function doesn't take immediate arrays (like explode())
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83965@lists.php.net to get a copy of this message
From: d-tail at msx dot org Operating system: Windows XP PHP version: 5.1.0RC1 PHP Bug Type: Arrays related Bug description: The array_pop()-function doesn't take immediate arrays (like explode()) Description: ------------ The array_pop()-function (and most likely, similar array operators) doesn't take immediate arrays anymore, that is, arrays without a variable name. It worked in previous versions, though. Reproduce code: --------------- <?php $bread = "slice1.slice2.slice3.slice4"; $last_slice = array_pop(explode(".", $bread)); echo($last_slice); ?> Expected result: ---------------- Expect to see: "slice4" Workaround: <?php $bread = "slice1.slice2.slice3.slice4"; $slices_array = explode(".", $bread); $last_slice = array_pop($slices_array); echo($last_slice); ?> Actual result: -------------- Fatal error: Only variables can be passed by reference in D:\www\browser\index.php on line 46 -- Edit bug report at http://bugs.php.net/?id=34244&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34244&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34244&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34244&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34244&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34244&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34244&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34244&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34244&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34244&r=support Expected behavior: http://bugs.php.net/fix.php?id=34244&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34244&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34244&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34244&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34244&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34244&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34244&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34244&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34244&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34244&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34244&r=mysqlcfg

« previous php.bugs (#83965) next »