- var_dump: documentation ( source)
- time: documentation ( source)
- end: documentation ( source)
<?php
$array = [];
for($i = 0; 9999 > $i; $i++){
$array[] = $i;
}
$startTimeForLoop = time();
foreach($array as $key => $value){
$foo = 'bar';
}
echo 'time needed for loop: ' . time()-$startTimeForLoop;
echo '<br>';
$startTimeForEnd = time();
var_dump(end($array));
echo 'time needed for end()' . time()-$startTimeForEnd;