3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $body = "something use Modules\Cms\Classes\Content; use Modules\Cms\Classes\Theme; use Modules\System\Classes\ApplicationException; use Modules\Cms\Classes\Router; class ... "; echo chr(92); $namespaces = array(); preg_match_all('/(use\s+[a-z0-9_\\\]+;)/mi', $body, $namespaces); print_r($namespaces);
Output for 4.3.0 - 7.1.0
\Array ( [0] => Array ( [0] => use Modules\Cms\Classes\Content; [1] => use Modules\Cms\Classes\Theme; [2] => use Modules\System\Classes\ApplicationException; [3] => use Modules\Cms\Classes\Router; ) [1] => Array ( [0] => use Modules\Cms\Classes\Content; [1] => use Modules\Cms\Classes\Theme; [2] => use Modules\System\Classes\ApplicationException; [3] => use Modules\Cms\Classes\Router; ) )