3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $routesBundle = []; $routesBundle['main']['route'] = true; $routesBundle['main']['alt1'] = true; $routesBundle['main']['alt2'] = true; $routesBundle['rif']['route'] = true; $routesBundle['rif']['alt1'] = true; $routesBundle['rif']['alt2'] = true; foreach ($routesBundle as $bKey => $routes) { if ($bKey) { echo "\n" . $bKey . '<br>'; } foreach ($routes as $rKey => $route) { if ($rKey < count($routes) - 1 && $rKey < count($routes) - 1) { echo "\n" . $route . '<br>'; } } }
based on PmhKb
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
main<br> 1<br> 1<br> 1<br> rif<br> 1<br> 1<br> 1<br>