3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = 'application/vnd.github.full+json'; $pattern = '#(?P<maintype>[a-z].*)/(?P<fullsubtype>(?P<subtype>[a-z0-9.-]*)([+](?P<submediatype>[a-z]*)))?#i'; preg_match($pattern, $string, $matches); var_dump($matches);
Output for 4.3.3 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(10) { [0]=> string(32) "application/vnd.github.full+json" ["maintype"]=> string(11) "application" [1]=> string(11) "application" ["fullsubtype"]=> string(20) "vnd.github.full+json" [2]=> string(20) "vnd.github.full+json" ["subtype"]=> string(15) "vnd.github.full" [3]=> string(15) "vnd.github.full" [4]=> string(5) "+json" ["submediatype"]=> string(4) "json" [5]=> string(4) "json" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.3.2
array(6) { [0]=> string(32) "application/vnd.github.full+json" [1]=> string(11) "application" [2]=> string(20) "vnd.github.full+json" [3]=> string(15) "vnd.github.full" [4]=> string(5) "+json" [5]=> string(4) "json" }