Ticket #21169: next-perf.php
| File next-perf.php, 293 bytes (added by devesine, 11 months 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 | do { |
| 15 | $val = current($arr); |
| 16 | } while ( next($arr) !== false); |
| 17 | |
| 18 | echo (microtime(true) - $ts) . PHP_EOL; |
