3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $matches = array(); // $controller = $this->getRequest()->attributes->get('_controller'); $controller = "Acme\MyBundle\Controller\MyController::myAction"; preg_match('/(.*)\\\MyBundle\\\Controller\\\(.*)Controller::(.*)Action/', $controller, $matches); print_r($matches);
Output for 4.3.0 - 7.1.0
Array ( [0] => Acme\MyBundle\Controller\MyController::myAction [1] => Acme [2] => My [3] => my )