3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ms = microtime(); $array = array(); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>'; $ms = microtime(); $array = array(); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>'; $ms = microtime(); $array = array('String', 'Not String'); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>'; $ms = microtime(); $array = array('String', 'Not String'); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . ($ms - microtime()) . ' ms<br>';

preferences:
36.58 ms | 402 KiB | 5 Q