php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34480 Fatal error: Only variables can be passed by reference in...
Submitted: 2005-09-12 14:15 UTC Modified: 2005-09-12 14:21 UTC
From: alesegala at users dot sourceforge dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.5 OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alesegala at users dot sourceforge dot net
New email:
PHP Version: OS:

 

 [2005-09-12 14:15 UTC] alesegala at users dot sourceforge dot net
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);
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-12 14:21 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 04 07:00:01 2025 UTC