From: alesegala at users dot sourceforge dot net
Operating system: Irrelevant
PHP version: 5.0.5
PHP Bug Type: Scripting Engine problem
Bug description: Fatal error: Only variables can be passed by reference in...
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);
}
--
Edit bug report at http://bugs.php.net/?id=34480&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34480&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34480&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34480&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34480&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34480&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34480&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34480&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34480&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34480&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34480&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34480&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34480&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34480&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34480&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34480&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34480&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34480&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34480&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34480&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34480&r=mysqlcfg