3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $calledby = debug_backtrace(); print_r($calledby); // does not work $caller = (strlen($calledby[1]['class'])) ? $calledby[1]['class'] : $calledby[0]['class']; // works and does does not segfault if (strlen($calledby[1]['class'])) $caller = $calledby[1]['class']; else $caller = $calledby[0]['class']; # arguments are required if (!func_num_args()) { return; } # fill variables with argument contents if exists $variables = (func_num_args() == 0) ? NULL : (is_array(func_get_arg(0)) ? func_get_arg(0) : NULL);
Output for 5.3.0 - 5.6.23, 7.0.0 - 7.1.0
Array ( ) Notice: Undefined offset: 1 in /in/vVmrH on line 4 Notice: Undefined offset: 0 in /in/vVmrH on line 4 Notice: Undefined offset: 1 in /in/vVmrH on line 6 Notice: Undefined offset: 0 in /in/vVmrH on line 7 Warning: func_num_args(): Called from the global scope - no function context in /in/vVmrH on line 10 Warning: func_num_args(): Called from the global scope - no function context in /in/vVmrH on line 12 Warning: func_get_arg(): Called from the global scope - no function context in /in/vVmrH on line 12
Output for hhvm-3.10.0 - 3.12.0
Array ( ) Notice: Undefined index: 1 in /in/vVmrH on line 4 Notice: Undefined index: 0 in /in/vVmrH on line 4 Notice: Undefined index: 1 in /in/vVmrH on line 6 Notice: Undefined index: 0 in /in/vVmrH on line 7 Warning: func_num_args(): Called from the global scope - no function context in /in/vVmrH on line 10 Warning: func_num_args(): Called from the global scope - no function context in /in/vVmrH on line 12 Warning: func_get_arg(): Called from the global scope - no function context in /in/vVmrH on line 12
Output for 5.0.0 - 5.2.17
Array ( ) Notice: Undefined offset: 1 in /in/vVmrH on line 4 Notice: Undefined offset: 0 in /in/vVmrH on line 4 Notice: Undefined offset: 1 in /in/vVmrH on line 6 Notice: Undefined offset: 0 in /in/vVmrH on line 7 Warning: func_num_args(): Called from the global scope - no function context in /in/vVmrH on line 10 Warning: func_num_args(): Called from the global scope - no function context in /in/vVmrH on line 12 Warning: func_get_arg(): Called from the global scope - no function context in /in/vVmrH on line 12
Output for 4.3.2 - 4.4.9
Array ( ) Notice: Undefined offset: 1 in /in/vVmrH on line 4 Notice: Undefined offset: 0 in /in/vVmrH on line 4 Notice: Undefined offset: 1 in /in/vVmrH on line 6 Notice: Undefined offset: 0 in /in/vVmrH on line 7 Fatal error: func_num_args(): Can't be used as a function parameter in /in/vVmrH on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Array ( ) Notice: Undefined offset: 1 in /in/vVmrH on line 4 Notice: Undefined offset: 0 in /in/vVmrH on line 4 Notice: Undefined offset: 1 in /in/vVmrH on line 6 Notice: Undefined offset: 0 in /in/vVmrH on line 7 Fatal error: func_num_args(): Can't be used as a function parameter in /in/vVmrH on line 10