xref: /PHP-5.4/ext/standard/tests/array/bug35022.phpt (revision 57510065)
1--TEST--
2Bug #35022 (Regression in the behavior of key/current functions)
3--FILE--
4<?php
5$state = array("one" => 1, "two" => 2, "three" => 3);
6function foo( &$state ) {
7    $contentDict = end( $state );
8    for ( $contentDict = end( $state ); $contentDict !== false; $contentDict = prev( $state ) ) {
9	echo key($state) . " => " . current($state) . "\n";
10    }
11}
12foo($state);
13reset($state);
14var_dump( key($state), current($state) );
15?>
16--EXPECT--
17three => 3
18two => 2
19one => 1
20string(3) "one"
21int(1)
22