3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "1 800-555-1111", "1 222-555-1111", "888-555-1111", "1 888 555 1111", "1 ", "1 2" ]; $pattern = '/^1\h+(?=\d(?:[^\d\n\r]?\d){9}$)/'; foreach ($strings as $s) { echo preg_replace($pattern, '', $s) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
800-555-1111 222-555-1111 888-555-1111 888 555 1111 1 1 2

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:
26.25 ms | 405 KiB | 5 Q