3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '[a-z\d+#.-]+(?:;[a-z\d+#.-]+)*'; // Borrowed from @Hamza. $tags =<<<TAGS gg!!gd 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; if (preg_match('/'.$pattern.'/', $tags)) { var_dump(substr_count($tags, ';')); }

preferences:
33.73 ms | 402 KiB | 5 Q