3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mx = function ($high_val) { return function ($val) use ($high_val) { return $val > $high_val; }; }; $i = array(1, 2, 3, 4, 5, 6, 7); $o = array_filter($i, $mx(3)); var_dump($o); ?>
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.29, 8.0.0 - 8.0.19, 8.1.0 - 8.1.6
array(4) { [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) }

preferences:
55.18 ms | 409 KiB | 5 Q