3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function sum() { $list = array(); $prepare = function($value) use(&$prepare, &$list) { if (is_array($value)) { return $prepare(array_merge($list, $value));//array_map($prepare, ); } $list[] = $value; }; $args = func_get_args(); array_walk($args, $prepare, $list); var_dump($list); return addition(0, $list); } function addition($sum, array &$list) { return empty($list) ? $sum : addition($sum + array_pop($list), $list); } $vars = range(1, 10); echo sum(array($vars), array(1));
based on QT7Mf
Output for 7.0.20 - 7.2.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /in/nBHkF on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.6
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/nBHkF on line 7
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes) in /in/nBHkF on line 7
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /in/nBHkF on line 7
Process exited with code 255.