3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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) { var_dump($route); echo PHP_EOL; var_dump($controller); }
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(21) "administrator/clients" string(21) "administrator/clients" string(27) "administrator/client/(:num)" string(31) "administrator/clients/client/$1"
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
string(21) "administrator/clients" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AP22J on line 11 PHP_EOLstring(21) "administrator/clients" string(27) "administrator/client/(:num)" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AP22J on line 11 PHP_EOLstring(31) "administrator/clients/client/$1"