<?php
$x = array(0 => 1, 2 => 3, 4 => 5, 6 => 7, 8 => 9);
foreach (array_keys($x) as $key => $value) {
echo $key . "->". $value."\n";
}
echo next($x)."\n";
echo next($x)."\n";
$y = $x;
echo next($y)."\n";
echo next($y)."\n";
reset($y);
echo next($x)."\n";
echo next($y)."\n";
- Output for 7.0.15 - 7.0.20, 7.1.1 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
- 0->0
1->2
2->4
3->6
4->8
3
5
7
9
7
3
- Output for 7.0.0 - 7.0.14, 7.1.0
- 0->0
1->2
2->4
3->6
4->8
3
5
3
5
7
3
preferences:
160.11 ms | 402 KiB | 174 Q