ID:               34468
 User updated by:  j dot gizmo at aon dot at
 Reported By:      j dot gizmo at aon dot at
 Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: Windows 2000 Server
 PHP Version:      5.0.5
 Assigned To:      zeev
 New Comment:

Okay, this bug isn't critical, but why is it a bogus? Is 
current() supposed to work on variables only? In all previous 
versions of PHP it worked on all arrays, wheter returned from 
a function or stored in a variable or whatever. So WHY the new 
behaviour starting with 5.0.5?


Previous Comments:
------------------------------------------------------------------------

[2005-09-12 00:27:42] [EMAIL PROTECTED]

There's nothing critical here, fix your scripts.


------------------------------------------------------------------------

[2005-09-12 00:17:56] [EMAIL PROTECTED]

> Feel free to fix the whole engine though with a patch...

Who broke it is a more appropriate question. By "broke it" I mean
applied your patch to the 5.0 branche.

Assign to the RM.

Since when we broke running scripts between bug fixes releases (ie
5.0.5). Whether this code is bad (it was not until recently, how can
one knows?) or not is not the point.

Any good explanation? I do not consider "Your code is bad" as a good
one.



------------------------------------------------------------------------

[2005-09-11 23:43:45] [EMAIL PROTECTED]

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...

------------------------------------------------------------------------

[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

Reply via email to