#47309 [NEW]: STRICT Error?

From: Date: Wed, 04 Feb 2009 17:26:20 +0000
Subject: #47309 [NEW]: STRICT Error?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133492@lists.php.net to get a copy of this message
From: noah at rave dot ca Operating system: Windows 2003 PHP version: 5.2.8 PHP Bug Type: Unknown/Other Function Bug description: STRICT Error? Description: ------------ I'm not sure if this is a bug or not but the bottom code works fine... The top one I try to merge two statements and it does not work... Shows Strict Standards: Only variables should be passed by reference in z.php on line 3 But it works if you separate the statements... I know this is not how you would normally code any of this stuff... It just seems weird there is an error... Reproduce code: --------------- <?php $file = '/path/to/some/file.ext'; $extension = array_pop($fileParts = explode('.', basename($file))); //Strict Standards: Only variables should be passed by reference in z.php on line 3 echo $extension . "\n"; // This works, echoes 'ext' echo count($fileParts); // Value is 2 ?> <?php $file = '/path/to/some/file.ext'; $fileParts = explode('.', basename($file)); $extension = array_pop($fileParts); echo $extension . "\n"; // This works, echoes 'ext' echo count($fileParts); // Value is 1 ?> Expected result: ---------------- I expect not to get a strict error cause both are the same... If it works for the bottom one, it should work for the top one... -- Edit bug report at http://bugs.php.net/?id=47309&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47309&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47309&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47309&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47309&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47309&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47309&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47309&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47309&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47309&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47309&r=support Expected behavior: http://bugs.php.net/fix.php?id=47309&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47309&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47309&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47309&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47309&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47309&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47309&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47309&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47309&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47309&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47309&r=mysqlcfg

« previous php.bugs (#133492) next »