3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 1; $i < 10; $i++) { $context = get_defined_vars(); $functions[$i] = function ($a) use ($context) { extract($context); return $a + $i; }; } echo $functions[4](7);

preferences:
37.62 ms | 402 KiB | 5 Q