3v4l.org

run code in 300+ PHP versions simultaneously
<?php $GLOBALS['menus'] = array('randomarray', 'nothing'); echo 'firstarray<br>'; print_r($GLOBALS['menus']); // PRINTS THE CORRECT ARRAY class MENU{ public function getMenu($menutype){ echo 'secondarray<br>';print_r($GLOBALS['menus']); // PRINTS MENU Object ( ) switch($menutype){ case 'submenu': case 'sidemenu': /*foreach($GLOBALS['menus'][$menutype] as $menu => $menuitem){ foreach($menuitem as $menuattr => $menuval){ echo '<li><a href="'.$menuval['url'].'" class="'; if(isset($_GET['dir'])){ echo ($_GET['dir'] === $menu) ? 'active' : ''; }else{ echo isset($menuval['active']) ? 'active' : ''; } echo '"></a></li>'; } }*/ break; } } }
Output for git.master, git.master_jit, rfc.property-hooks
firstarray<br>Array ( [0] => randomarray [1] => nothing )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
18.47 ms | 401 KiB | 8 Q