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']; print_r($args); var_dump($args); foreach ($args as $arg); for ($i = 0; $i < count($args); $i++) { var_dump($args[$i]); } } brokenTrace("A", "B");
based on igHPm
Output for 7.1.10 - 7.2.0
Array ( [0] => A [1] => B ) array(2) { [0]=> string(1) "A" [1]=> string(1) "B" } string(1) "A" string(1) "B" Array ( [0] => [1] => B ) array(2) { [0]=> NULL [1]=> string(1) "B" } NULL string(1) "B" Array ( [0] => [1] => ) array(2) { [0]=> NULL [1]=> NULL } NULL NULL
Output for 7.0.0 - 7.1.7
Array ( [0] => A [1] => B ) array(2) { [0]=> string(1) "A" [1]=> string(1) "B" } string(1) "A" string(1) "B" Array ( [1] => B ) array(1) { [1]=> string(1) "B" } Notice: Undefined offset: 0 in /in/tTmDb on line 23 NULL Array ( ) array(0) { }
Output for 5.3.18 - 5.6.28
Array ( [0] => A [1] => B ) array(2) { [0]=> &string(1) "A" [1]=> &string(1) "B" } string(1) "A" string(1) "B" Array ( [0] => A [1] => B ) array(2) { [0]=> &string(1) "A" [1]=> &string(1) "B" } string(1) "A" string(1) "B" Array ( [0] => A [1] => B ) array(2) { [0]=> &string(1) "A" [1]=> &string(1) "B" } string(1) "A" string(1) "B"