xref: /PHP-8.1/ext/standard/tests/array/bug21998.phpt (revision 782352c5)
1--TEST--
2Bug #21998 (array_pop() does not reset the current array position)
3--FILE--
4<?php
5
6$a = array("a", "b", "c");
7
8var_dump(key($a));
9var_dump(array_pop($a));
10var_dump(key($a));
11var_dump(array_pop($a));
12var_dump(key($a));
13var_dump(array_pop($a));
14var_dump(key($a));
15
16?>
17--EXPECT--
18int(0)
19string(1) "c"
20int(0)
21string(1) "b"
22int(0)
23string(1) "a"
24NULL
25