3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0, 10000); $time = microtime(true); $b = array_filter($a, function($el) { return $el % 2 === 0; }); var_dump(microtime(true) - $time); $b = []; $time = microtime(true); foreach ($a as $el) { if ($el % 2 === 0) { $b[] = $el; } } var_dump(microtime(true) - $time);

preferences:
35.27 ms | 402 KiB | 5 Q