3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match("/^(img|js|css)\/(?P<path>[a-zA-Z0-9\-._~!$&'()*+,;=:@]+)$/", 'img/asasas', $m); var_dump($m);
Output for 4.3.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(4) { [0]=> string(10) "img/asasas" [1]=> string(3) "img" ["path"]=> string(6) "asasas" [2]=> string(6) "asasas" }
Output for 4.3.0 - 4.3.2
array(3) { [0]=> string(10) "img/asasas" [1]=> string(3) "img" [2]=> string(6) "asasas" }