#34468 [Opn->Bgs]: Fatal error for current
| From: | derick@php.net | Date: | Sun, 11 Sep 2005 21:43:46 +0000 |
| Subject: | #34468 [Opn->Bgs]: Fatal error for current | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84879@lists.php.net to get a copy of this message | ||
ID: 34468
Updated by: derick@php.net
Reported By: j dot gizmo at aon dot at
-Status: Open
+Status: Bogus
Bug Type: Reproducible crash
Operating System: Windows 2000 Server
PHP Version: 5.0.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Feel free to fix the whole engine though with a patch...
Previous Comments:
------------------------------------------------------------------------
[2005-09-11 23:35:16] j dot gizmo at aon dot at
Description:
------------
current() only works on variables; no longer on arrays
returned from functions.
This also explains Bug #34424, which has been classified as
Bogus.
Reproduce code:
---------------
$x = current(explode(' ','a b'));
echo $x;
Expected result:
----------------
a
Actual result:
--------------
Fatal error: Only variables can be passed by reference in ...
--------------
However, the following DOES work as expected:
$a = current($x=&explode(" ","a b"));
This new behaviour breaks backward compatibility. Furthermore,
it introduces continuity problems. In both cases, an array is
passed to current(), only one time it is stored in a variable
and the other time it isn't. This should not make a
difference, because even a "temporary array" should have a
current element.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34468&edit=1