3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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;
based on 7LeKu
Output for 7.1.0 - 7.3.0alpha1
Warning: A non-numeric value encountered in /in/dVAre on line 12 -1527660100<br>int(9998) Warning: A non-numeric value encountered in /in/dVAre on line 17 -1527660100
Output for 5.6.0 - 5.6.3, 5.6.5 - 5.6.30, hhvm-3.21.3 - 3.22.0
-1527660100<br>int(9998) -1527660100
Output for 5.6.4, hhvm-3.18.5
-1527660101<br>int(9998) -1527660101