3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 20; $a = function ($n) { return 10 * floor($n / 4); }; $b = function ($n) { return 2 ** ($n % 4); }; $values = []; for ($n = 0; $input >= $value = $a($n) + $b($n) ; ++$n) { $values[] = $value; } echo implode(' ', $values);

preferences:
26.76 ms | 405 KiB | 5 Q