3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $menuitems = array(array('name'=>'First menu item', 'link'=>'http://firstitem.com','class'=>'normal'), array('name'=>'Second menu item', 'link'=>'http://second.com','class'=>'normal'), array('name'=>'Third menu item', 'link'=>'http://third.com','class'=>'normal') ); function printMenu($menutiem) { echo "<a href='{$menuitem['link']}' class='{$menuitem['class']}'>{$menuitem['name']}</a>"; } function genmenu($a_menuitems) { foreach ($menuitems as $menuitem) { printMenu($menuitem); } }
based on j6TeE
Output for 4.3.0 - 7.1.0