3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class c { function test() { $this->x(); } static function x() { $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); var_dump($bt[0]['type'] == '->'); var_dump(isset($this)); } }; $x = new c; $x->test();
Output for 5.3.6 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(false) bool(false)
Output for 5.2.5 - 5.3.5
Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in /in/NLELu on line 8 bool(false) bool(false)
Output for 5.0.0 - 5.2.4
Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in /in/NLELu on line 8 Warning: Wrong parameter count for debug_backtrace() in /in/NLELu on line 8 bool(false) bool(false)
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/NLELu on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/NLELu on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/NLELu on line 7
Process exited with code 255.