3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 20000; $i++) { $a[] = array( 'name' => 'John', 'city' => 'New York', 'age' => $i % 200 == 0 ? 21 : 28 ); } $time = microtime(true); $filtered = array_filter($a, function ($item) { return ($item['age'] == 21); }); $time = microtime(true) - $time; echo 'closure took ' . number_format($time, 3) . ' seconds and returned ' . count($filtered) . " entries\n";

preferences:
29.04 ms | 402 KiB | 5 Q