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) { $key = preg_replace('#[$][0-9]+#', '([^/]+)', $controller); // Converter alle $1, $2 osv til "hvad som helts") if (preg_match('#^' . $key . '$#', $uri, $match)) { // Okay. Den matcher på $controller (array value) // Nu skal vi så konvertere $uri til den $route, der tilhører $controller echo $route . " => " . $controller; // Det er en her route // $uri skal altså ligne "administrator/client/11" } }
Output for git.master, git.master_jit, rfc.property-hooks
administrator/client/(:num) => administrator/clients/client/$1

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