3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! function foo(){ bar(); } function bar() { foobar(); } function foobar() { foobared(); } function foobared() { if (PHP_VERSION >= '5.4') var_dump(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)); else var_dump(debug_backtrace()); } foo();
Output for 5.4.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> array(4) { ["file"]=> string(9) "/in/JPAQ6" ["line"]=> int(13) ["function"]=> string(8) "foobared" ["args"]=> array(0) { } } [1]=> array(4) { ["file"]=> string(9) "/in/JPAQ6" ["line"]=> int(9) ["function"]=> string(6) "foobar" ["args"]=> array(0) { } } }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.3.29
array(4) { [0]=> array(4) { ["file"]=> string(9) "/in/JPAQ6" ["line"]=> int(13) ["function"]=> string(8) "foobared" ["args"]=> array(0) { } } [1]=> array(4) { ["file"]=> string(9) "/in/JPAQ6" ["line"]=> int(9) ["function"]=> string(6) "foobar" ["args"]=> array(0) { } } [2]=> array(4) { ["file"]=> string(9) "/in/JPAQ6" ["line"]=> int(5) ["function"]=> string(3) "bar" ["args"]=> array(0) { } } [3]=> array(4) { ["file"]=> string(9) "/in/JPAQ6" ["line"]=> int(22) ["function"]=> string(3) "foo" ["args"]=> array(0) { } } }