#46535 [NEW]: arrays internal pointer saved in function
| From: | max_m at eyelinkmedia dot com | Date: | Mon, 10 Nov 2008 13:34:28 +0000 |
| Subject: | #46535 [NEW]: arrays internal pointer saved in function | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-1476@lists.php.net to get a copy of this message | ||
From: max_m at eyelinkmedia dot com
Operating system: MacOs X
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: arrays internal pointer saved in function
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 bug report at http://bugs.php.net/?id=46535&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46535&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46535&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46535&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46535&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46535&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46535&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46535&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46535&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46535&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46535&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46535&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46535&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46535&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46535&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46535&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46535&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46535&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46535&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46535&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46535&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46535&r=mysqlcfg