3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function sumrand($n,$sum) { if ($n== 0) { return $sum; } else { return (sumrand($n-1,$sum+rand(0,1))); } } echo sumrand(500000,0)."\n";
Output for 7.0.0 - 7.1.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/kW6st on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.21
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/kW6st on line 8
Process exited with code 255.
Output for 5.5.0 - 5.5.35
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes) in /in/kW6st on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in /in/kW6st on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in /in/kW6st on line 8
Process exited with code 255.
Output for 4.3.0 - 5.2.17

Process exited with code 139.