Ticket #21169: each-perf.php
File each-perf.php, 287 bytes (added by , 9 years ago) |
---|
Line | |
---|---|
1 | <?php |
2 | global $arr; |
3 | $i = 0; |
4 | $tmp = ''; |
5 | while($i < 10000) { |
6 | $tmp .= 'a'; |
7 | ++$i; |
8 | } |
9 | $arr = array_fill(100000000000000000000000, 100, $tmp); |
10 | unset($i, $tmp); |
11 | |
12 | $ts = microtime(true); |
13 | reset($arr); |
14 | while($next = each($arr)) { |
15 | $val = $next['value']; |
16 | }; |
17 | |
18 | echo (microtime(true) - $ts) . PHP_EOL; |