3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function brokenTrace($arg1, $arg2) { backtraceWrapper(); unset($arg1); backtraceWrapper(); unset($arg2); backtraceWrapper(); } function backtraceWrapper() { $bt = debug_backtrace(); $args = $bt[1]['args']; for ($i = 0; $i < count($args); $i++) { var_dump($args[$i]); } } brokenTrace("A", "B");
Output for 7.1.10 - 7.2.0
string(1) "A" string(1) "B" NULL string(1) "B" NULL NULL
Output for 7.0.0 - 7.1.7
string(1) "A" string(1) "B" Notice: Undefined offset: 0 in /in/CSZs7 on line 17 NULL
Output for 5.3.18 - 5.6.28
string(1) "A" string(1) "B" string(1) "A" string(1) "B" string(1) "A" string(1) "B"