3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function a($depth = 0) { //return last backtrace call. If backtrace bigger then 3, return third call. if($depth === 1000) { debug_backtrace(false, 3); } return a(++$depth, str_repeat("a", 1000)); } var_dump(a());
Output for 7.1.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/NOkDf on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /in/NOkDf on line 10
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Stack overflow in /in/NOkDf on line 10
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1001 bytes) in /in/NOkDf on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Warning: debug_backtrace() expects at most 1 parameter, 2 given in /in/NOkDf on line 7 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /in/NOkDf on line 10
Process exited with code 255.
Output for 5.2.5 - 5.2.17
Warning: debug_backtrace() expects at most 1 parameter, 2 given in /in/NOkDf on line 7
Process exited with code 139.
Output for 4.3.0 - 5.2.4
Warning: Wrong parameter count for debug_backtrace() in /in/NOkDf on line 7
Process exited with code 139.