3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $navigation = array( array( "title" => "Overzicht", "enabled" => 1, "submenu" => array( array( "title" => "Dashboard", "url" => "dashboard/", "module" => "Home", "icon" => "icon-home", "userlevel" => 0, "enabled" => 1 ), array( "title" => "Mijn statistieken", "url" => "user/stats/", "module" => "User", "icon" => "icon-stats", "userlevel" => 60, "enabled" => 1 ) ) ), array( "title" => "Acties", "enabled" => 1, "submenu" => array( array( "title" => "Alle acties", "url" => "action/", "module" => "Action", "icon" => "icon-list-alt", "userlevel" => 0, "enabled" => 1 ), array( "title" => "Mijn acties", "url" => "action/:user_id/", "module" => "Action", "icon" => "icon-list", "userlevel" => 60, "enabled" => 1 ), array( "title" => "Nieuwe actie", "url" => "new/", "module" => "Action", "icon" => "icon-plus", "userlevel" => 80, "enabled" => 1 ) ) ) ); $filterFunc = function($arr) use (&$filterFunc) { foreach ($arr as $k => $v) { if (isset($v["userlevel"])) { if (!($v["userlevel"] >= 60)) unset($arr[$k]); } if (isset($v["submenu"])) { $filterFunc($v["submenu"]); } } }; $filterFunc($navigation); var_dump($navigation)
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected end of file in /in/t3bYs on line 73
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/t3bYs on line 73
Process exited with code 255.