3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = 'test asdbtestkuiasd TEST asdbctest'; $pattern = '/(test)/i'; $count = preg_match_all($pattern, $string, $matches); echo $count; print_r($matches);
based on EQZH7
Output for 5.3.18 - 7.2.0
4Array ( [0] => Array ( [0] => test [1] => test [2] => TEST [3] => test ) [1] => Array ( [0] => test [1] => test [2] => TEST [3] => test ) )