3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uri = 'administrator/clients/client/11'; // function input $routes = array( 'administrator/clients' => 'administrator/clients', 'administrator/client/(:num)' => 'administrator/clients/client/$1', ); foreach ($routes as $route => $controller) { if (preg_match('/(\$\d+)/', $controller, $matches) { echo $route . " => " . $controller; // Det er en her route } }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '{' in /in/q53Fl on line 10
Process exited with code 255.

preferences:
196.14 ms | 1395 KiB | 67 Q