xref: /php-src/ext/spl/tests/array_006.phpt (revision f8d79582)
1--TEST--
2SPL: ArrayIterator without ArrayObject
3--INI--
4error_reporting=2047
5--FILE--
6<?php
7
8echo "==Normal==\n";
9
10$arr = array(0=>0, 1=>1, 2=>2);
11$obj = new ArrayIterator($arr);
12
13foreach($obj as $ak=>$av) {
14    foreach($obj as $bk=>$bv) {
15        if ($ak==0 && $bk==0) {
16            $arr[0] = "modify";
17        }
18        echo "$ak=>$av - $bk=>$bv\n";
19    }
20}
21
22?>
23--EXPECT--
24==Normal==
250=>0 - 0=>0
260=>0 - 1=>1
270=>0 - 2=>2
28