mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
4035a8ebc0
Fixed bug #37715 (array pointers resetting on copy)
30 lines
507 B
PHP
Executable File
30 lines
507 B
PHP
Executable File
--TEST--
|
|
Bug #37715 (array pointers resetting on copy)
|
|
--FILE--
|
|
<?php
|
|
$a = array(
|
|
'a' => array(
|
|
'A', 'B', 'C', 'D',
|
|
),
|
|
'b' => array(
|
|
'AA', 'BB', 'CC', 'DD',
|
|
),
|
|
);
|
|
|
|
// Set the pointer of $a to 'b' and the pointer of 'b' to 'CC'
|
|
reset($a);
|
|
next($a);
|
|
next($a['b']);
|
|
next($a['b']);
|
|
next($a['b']);
|
|
|
|
var_dump(key($a['b']));
|
|
foreach($a as $k => $d)
|
|
{
|
|
}
|
|
// Alternatively $c = $a; and foreachloop removal will cause identical results.
|
|
var_dump(key($a['b']));
|
|
--EXPECT--
|
|
int(3)
|
|
int(3)
|