3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pattern = "#^/([a-z]{2})/([a-zA-Z0-9_-]++)/([a-zA-Z0-9_-]++)(/.*+)?+/$#"; $subject = '/en/user/login/foo/'; var_dump(preg_match($pattern, $subject, $matches), $matches); $pattern = '/en/user/login'; var_dump(preg_match($pattern, $subject, $matches), $matches);
Output for 4.3.11 - 7.1.0
int(0) array(0) { } Warning: preg_match(): Unknown modifier 'r' in /in/cdNJF on line 8 bool(false) array(0) { }
Output for 4.3.0 - 4.3.10
int(0) array(0) { } Warning: Unknown modifier 'r' in /in/cdNJF on line 8 bool(false) array(0) { }