3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function arrToStr($arr){ $str = ""; foreach($arr as $a) $str .= $a; return $str; } $lol = array( "why" => ["wont", "this", "work"], "its" => ["pretty", "darn", "annoying"], "hur" => ["dur"] ); $omg = array_slice($lol, 1, count($lol), true); foreach($omg as $wtf => $bbq){ printf("%s: %s", $wtf, printArr($bbq)); }
based on EfNSr
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function printArr() in /in/mcKJJ:18 Stack trace: #0 {main} thrown in /in/mcKJJ on line 18
Process exited with code 255.
Output for 5.4.12 - 5.6.28
Fatal error: Call to undefined function printArr() in /in/mcKJJ on line 18
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/mcKJJ on line 10
Process exited with code 255.