3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = 'fact = true, fact2 = false, fact3 = true'; preg_match_all('/(\w+)\s*=\s*(true|false)/i', $test, $result); var_dump($result); ?>
based on snJ4u
Output for 5.6.0 - 5.6.38, hhvm-3.15.4, 7.0.0 - 7.3.1
array(3) { [0]=> array(3) { [0]=> string(11) "fact = true" [1]=> string(13) "fact2 = false" [2]=> string(18) "fact3 = true" } [1]=> array(3) { [0]=> string(4) "fact" [1]=> string(5) "fact2" [2]=> string(5) "fact3" } [2]=> array(3) { [0]=> string(4) "true" [1]=> string(5) "false" [2]=> string(4) "true" } }