diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-03-22 16:37:34 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-03-22 16:37:34 +0300 |
commit | 8598240c69801479cef134bac29b12c233aca075 (patch) | |
tree | d85ec783900f02e06cd9216dbce20faca8234ea6 /ext | |
parent | e791e93b55ce6164b668683c6363969f43e0a19e (diff) | |
download | php-git-8598240c69801479cef134bac29b12c233aca075.tar.gz |
Fixed a behavior break introduced by d7f2dc4ec651628e10213625db6aee3559e214a9
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/tests/array/current_variation6.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/standard/tests/array/current_variation6.phpt b/ext/standard/tests/array/current_variation6.phpt new file mode 100644 index 0000000000..970c7d4045 --- /dev/null +++ b/ext/standard/tests/array/current_variation6.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test current() function : internal pointer maintenance at the end of array +--FILE-- +<?php +$array = ["foo" => 1, "bar" => 2, "baz" => 3]; +reset($array); +while ($cur = current($array)) { + var_dump($cur); + next($array); +} + +unset($array["baz"]); +$array[] = 4; +var_dump(current($array)); +?> +--EXPECT-- +int(1) +int(2) +int(3) +int(4) |