3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pattern = '(?:;?[a-z\d+#.-]+)+'; // Borrowed from @Hamza. $tags =<<<TAGS gggd hfhfghg;hfhdfh fgjfgjgf;hfhdfh;hfhdfh fgjgfj;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh;hfhdfh TAGS; var_dump(preg_match_all('/'.$pattern.'/', $tags)); if (preg_match('/'.$pattern.'/', $tags)) { var_dump(substr_count($tags, ';')); }
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(8) int(28)
Output for 4.3.4 - 4.4.1, 4.4.3 - 5.1.1, 5.1.3 - 5.3.29
Warning: preg_match_all() expects at least 3 parameters, 2 given in /in/vH0A8 on line 15 bool(false) int(28)
Output for 4.4.2, 5.1.2
Warning: preg_match_all() expects at least 3 parameters, 2 given in /in/vH0A8 on line 16 bool(false) int(28)
Output for 4.3.3

Process exited with code 139.
Output for 4.3.0 - 4.3.2
Warning: Wrong parameter count for preg_match_all() in /in/vH0A8 on line 15 NULL int(28)