3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/^(?:\+?1\h?)?(?:(\()?\d{3}(?(1)\))([-. ]?)\d{3}\2\d{4}|\d{11})$/m'; $str = '589-845-2889 (589)-845-2889 589.845.2889 589 845 2889 5898452889 (589) 845 2889 1(589) 845 2889 +1(589) 845 2889 1589 845 2889 1 589 845 2889 15898452889 +1207 244 7002 +1 207 244 7002'; preg_match_all($re, $str, $matches); print_r($matches[0]);
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [0] => 589-845-2889 [1] => (589)-845-2889 [2] => 589.845.2889 [3] => 589 845 2889 [4] => 5898452889 [5] => (589) 845 2889 [6] => 1(589) 845 2889 [7] => +1(589) 845 2889 [8] => 1589 845 2889 [9] => 1 589 845 2889 [10] => 15898452889 [11] => +1207 244 7002 [12] => +1 207 244 7002 )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.35 ms | 1464 KiB | 4 Q