|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-12 14:21 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 06:00:01 2025 UTC |
Description: ------------ I found this bug twice. It always worked before, but with PHP 5.1RC1 and 5.0.5 these two scripts don't work: In script I developed (you can see the function that cause error in the code below). The error is: Fatal error: Only variables can be passed by reference in ... I found this bug in phpBB (last version) too, in the same server, when I try to post. This is the error: Fatal error: Only variables can be passed by reference in C:\[...]\forum\posting.php on line 555 I'm using Windows XP Pro SP2, Apache2, PHP 5.0.5 (but this bug is in 5.1.0RC1 too). PHP is running as CLI Reproduce code: --------------- This is a code I wrote: // Get filename and extension function get_filename_parts($file) { $extension = end(explode(".", $file)); $filename = substr($file, 0, -(strlen($extension)+1) ); return array($filename, $extension); } Now it works: // Get filename and extension function get_filename_parts($file) { $split = explode(".", $file); $extension = end($split); $filename = substr($file, 0, -(strlen($extension)+1) ); return array($filename, $extension); }