3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $num = "636-227-8787"; if (preg_match('/^.*?(\d{3}).*?(\d{3}).*?(\d{4}).*/', $num, $matches)) { var_dump($matches); }
Output for 4.3.0 - 7.2.0
array(4) { [0]=> string(12) "636-227-8787" [1]=> string(3) "636" [2]=> string(3) "227" [3]=> string(4) "8787" }