3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match_all('/([a-z0-9_]+)::([a-z0-9_]+)/', 'lol::second::third::fourth', $matches, PREG_OFFSET_CAPTURE); var_dump($matches);
based on p3BQP
Output for 4.3.3 - 7.1.0
array(3) { [0]=> array(2) { [0]=> array(2) { [0]=> string(11) "lol::second" [1]=> int(0) } [1]=> array(2) { [0]=> string(13) "third::fourth" [1]=> int(13) } } [1]=> array(2) { [0]=> array(2) { [0]=> string(3) "lol" [1]=> int(0) } [1]=> array(2) { [0]=> string(5) "third" [1]=> int(13) } } [2]=> array(2) { [0]=> array(2) { [0]=> string(6) "second" [1]=> int(5) } [1]=> array(2) { [0]=> string(6) "fourth" [1]=> int(20) } } }
Output for 4.3.0 - 4.3.2
Warning: Wrong value for parameter 4 in call to preg_match_all() in /in/fSrSp on line 4 NULL