#46535 [Opn->Csd]: arrays internal pointer saved in function
ID: 46535
Updated by: torben@php.net
Reported By: max_m at eyelinkmedia dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: MacOs X
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-09-03 06:49:16] svn@php.net
Automatic comment from SVN on behalf of torben
Revision: http://svn.php.net/viewvc/?view=revision&revision=287977
Log: Noted that the array pointer is no longer reset for array accesses
made within a function when the array has been passed to the function.
Addresses bug #46535.
--This line,
and those below, will be ignored--
M migration5.xml
------------------------------------------------------------------------
[2008-11-10 13:34:28] max_m at eyelinkmedia dot com
Description:
------------
php-manual "Backward Incompatible Changes" did not describe changes
with arrays internal pointers.
If I passed array to some function call_func($some_array)
internal pointer of $some_array reseted in php4, but saved in php5
Reproduce code:
---------------
$a = array (
'first' => 1,
'second' => 2,
);
function test($a) {
while (list($k, $v)=each($a))
echo $k."\n";
}
next($a);
test($a);
Expected result:
----------------
first
second
Or make in documented in "PHP: Backward Incompatible Changes"
Actual result:
--------------
In php4:
first
second
php5:
second
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46535&edit=1
Thread (2 messages)