php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47309 STRICT Error?
Submitted: 2009-02-04 17:26 UTC Modified: 2009-02-04 22:16 UTC
From: noah at rave dot ca Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.8 OS: Windows 2003
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: noah at rave dot ca
New email:
PHP Version: OS:

 

 [2009-02-04 17:26 UTC] noah at rave dot ca
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...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-04 22:16 UTC] jani@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 02 22:00:02 2025 UTC