3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $simpsons[0] = array("name"=>"Abe","parent"=>-1); $simpsons[1] = array("name"=>"Homer","parent"=>0); // Homer's parent is Abe $simpsons[2] = array("name"=>"Bart","parent"=>1); // Bart's parent is Homer $simpsons[3] = array("name"=>"Lisa","parent"=>1); // Lisa's parent is Homer $simpsons[4] = array("name"=>"Maggie","parent"=>1); // Maggie's parent is Homer function get_children($parent) { global $simpsons; for ($i = count($simpsons) as $index=>$onesimpson) { if ($onesimpson["parent"]==$parent) { echo "$onesimpson[name] is a child of ".$simpsons[$parent]["name"].".<br />\n"; echo $index; get_children($index); echo $index; } } } get_children(0); ?>
Output for 5.4.0 - 5.4.18
Parse error: syntax error, unexpected 'as' (T_AS), expecting ';' in /in/GaVWv on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_AS, expecting ';' in /in/GaVWv on line 12
Process exited with code 255.