3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Configure here: $userSpecifiedPath = '/'; // ================================================================ // Don't edit below // ================================================================ $routerConfig = <<<CONFIG [/] "Controller" = "HomepageController" [404] "Controller" = "404Controller" CONFIG; class Router { private $routes; public function __construct($routes) { $this->routes = $routes; } public function getControllerFromPath($path) { if(array_key_exists($path, $this->routes) === true) { return $this->routes[$path]; } elseif(array_key_exists('404', $this->routes) === true) { return $this->routes['404']; } } } $routes = ini_parse_string($routerConfig, true); $Router = new Router($routes); echo 'Using controller: ' . $Router->getControllerFromPath($userSpecifiedPath);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function ini_parse_string() in /in/864J1:41 Stack trace: #0 {main} thrown in /in/864J1 on line 41
Process exited with code 255.

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:
47.3 ms | 401 KiB | 8 Q