3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = []; for ($i = 0; $i < 1000; $i++) { $arr[] = 'Hi bro'; } $start = microtime(true); for ($i = 0; $i < count($arr); $i++) { } $test1 = microtime(true) - $start; $start = microtime(true); for ($i = 0, $count = count($arr); $i < $count; $i++) { } $test2 = microtime(true) - $start; if ($test2 < $test1) { echo "It good"; }
Output for 7.3.0 - 7.3.1, 7.3.3 - 7.3.32, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12
It good
Output for 7.3.2

preferences:
58.7 ms | 401 KiB | 75 Q