3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match_all( '/(foo)|(bar)|(baz)/', 'a foo b c baz d', $matches ); var_dump( $matches );
Output for 4.3.0 - 7.1.0
array(4) { [0]=> array(2) { [0]=> string(3) "foo" [1]=> string(3) "baz" } [1]=> array(2) { [0]=> string(3) "foo" [1]=> string(0) "" } [2]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } [3]=> array(2) { [0]=> string(0) "" [1]=> string(3) "baz" } }