- Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
- 0<br>int(9998) 0
<?php
$array = [];
for($i = 0; 9999 > $i; $i++){
$array[] = $i;
}
$startTimeForLoop = time();
foreach($array as $key => $value){
$foo = 'bar';
}
echo time()-$startTimeForLoop;
echo '<br>';
$startTimeForEnd = time();
var_dump(end($array));
echo time()-$startTimeForEnd;