3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matches = array(); // $controller = $this->getRequest()->attributes->get('_controller'); $controller = "Acme\MyBundle\Controller\MyController::myAction"; preg_match('/(.*)\\\\Bundle\\\\(.*)\\\\Controller\\\\(.*)Controller::(.*)Action/', $controller, $matches); print_r($matches);

preferences:
31.35 ms | 402 KiB | 5 Q