3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array_fill(0, 1000, 'xxxxx'); $runs = 100; $first = 0.0; $second = 0.0; for ($i = 0; $i < $runs; $i++) { $start = microtime(true); foreach ($arr as $value) { strpos('xxxxxxx', $value); } $end = microtime(true); $first += ($end-$start); } print "First: " . ($first/$runs) . PHP_EOL;

preferences:
24.9 ms | 406 KiB | 5 Q