3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = explode("\n", '(111) 222-3333 ((111) 222-3333 1112223333 111 222-3333 111-222-3333 (111)2223333 +11234567890 1-8002353551 123-456-7890 -Hello! +1 - 1234567890 '); foreach($numbers as $number) { print preg_replace('~.*(\d{3})[^\d]*(\d{3})[^\d]*(\d{4}).*~', '($1) $2-$3', $number). "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
(111) 222-3333 (111) 222-3333 (111) 222-3333 (111) 222-3333 (111) 222-3333 (111) 222-3333 (123) 456-7890 (800) 235-3551 (123) 456-7890 (123) 456-7890

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:
35.27 ms | 401 KiB | 8 Q