3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=0; $j=500000; while($i < 60000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting array_filter\n"; $x = 0; $test = array_filter($data1, function($str) use (&$x) { return ++$x % 2 != 0; }); $test = array_filter($data2, function($str) use (&$x) { return ++$x % 2 != 0; }); unset($test); $time = microtime(true) - $time; echo 'array_filter() took ' . number_format($time, 3) . " seconds\n";

preferences:
31.36 ms | 402 KiB | 5 Q