3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Class Render */ class Render { /** * @var array */ private static $renderProviders = array('Fixed', 'News', 'Service'); /** * @param $pageType */ public static function renderNavigationTree($pageType) { Render::getProvider($pageType)->renderNavigationTree(); } /** * @param $pageType * @return null */ private static function getProvider($pageType) { foreach (Render::$renderProviders as $renderProvider) { if ($renderProvider::getPageType() === $pageType) { return $renderProvider; } } return 'PageNotFound'; } /** * @param $pageType * @param Smarty $smarty * @param $pageID */ public static function renderPage($pageType, Smarty $smarty, $pageID) { Render::getProvider($pageType)->renderPage($smarty, $pageID); } }
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0rc3