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; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.120.0070.00420.52
8.4.110.0120.00518.98
8.4.100.0020.00717.80
8.4.90.0160.00517.98
8.4.80.0100.01019.56
8.4.70.0100.00618.03
8.4.60.0080.01220.54
8.4.50.0180.00517.90
8.4.40.0090.00920.69
8.4.30.0050.01422.23
8.4.20.0070.01319.99
8.4.10.0030.00621.93
8.3.250.0120.00618.78
8.3.240.0130.00716.51
8.3.230.0120.00816.74
8.3.220.0120.00620.79
8.3.210.0120.00816.68
8.3.200.0040.00416.65
8.3.190.0090.01019.03
8.3.180.0030.00416.92
8.3.170.0070.01118.90
8.3.160.0100.01016.89
8.3.150.0070.01117.22
8.3.140.0040.00417.13
8.3.130.0030.00618.49
8.3.120.0080.00020.84
8.3.110.0130.00320.94
8.3.100.0040.00418.63
8.3.90.0110.00426.77
8.3.80.0030.00718.43
8.3.70.0070.00716.75
8.3.60.0150.00416.75
8.3.50.0130.01018.48
8.3.40.0110.00323.65
8.3.30.0120.00318.81
8.3.20.0040.00424.18
8.3.10.0050.00224.66
8.3.00.0050.00326.16
8.2.290.0080.00918.93
8.2.280.0070.00218.63
8.2.270.0040.01417.07
8.2.260.0080.00020.80
8.2.250.0080.00016.73
8.2.240.0180.00417.37
8.2.230.0160.00322.58
8.2.220.0030.00624.06
8.2.210.0050.00326.77
8.2.200.0060.00318.66
8.2.190.0190.00316.75
8.2.180.0110.00716.63
8.2.170.0110.00319.07
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0070.00026.16
8.2.110.0070.00322.38
8.2.100.0040.00818.03
8.2.90.0040.00418.03
8.2.80.0040.00419.23
8.2.70.0050.00318.03
8.2.60.0190.00017.50
8.2.50.0150.00417.75
8.2.40.0150.00317.38
8.2.30.0100.00717.38
8.2.20.0100.00617.11
8.2.10.0120.00417.25
8.2.00.0130.00417.13
8.1.330.0120.00916.02
8.1.320.0130.00616.31
8.1.310.0120.00617.04
8.1.300.0070.00316.26
8.1.290.0040.00430.84
8.1.280.0090.00925.92
8.1.270.0050.00520.68
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00922.14
8.1.230.0060.00620.88
8.1.220.0080.00017.74
8.1.210.0040.00418.82
8.1.200.0040.00417.36
8.1.190.0140.00217.13
8.1.180.0090.00617.13
8.1.170.0130.00417.00
8.1.160.0120.00417.13
8.1.150.0090.00917.00
8.1.140.0180.00017.21
8.1.130.0110.00517.25
8.1.120.0110.00517.13
8.1.110.0080.00816.99
8.1.100.0170.00017.13
8.1.90.0110.00617.38
8.1.80.0140.00317.38
8.1.70.0050.01017.25
8.1.60.0130.00517.59
8.1.50.0130.00617.37
8.1.40.0130.00317.58
8.1.30.0130.00617.63
8.1.20.0110.00817.50
8.1.10.0090.00917.47
8.1.00.0190.00417.36
8.0.300.0000.00720.19
8.0.290.0090.00016.88
8.0.280.0160.00016.88
8.0.270.0100.00316.52
8.0.260.0060.01016.75
8.0.250.0080.00816.75
8.0.240.0060.00916.63
8.0.230.0170.00016.71
8.0.220.0150.00216.59
8.0.210.0110.00516.75
8.0.200.0080.00816.75
8.0.190.0100.00716.63
8.0.180.0100.00716.60
8.0.170.0090.00816.62
8.0.160.0120.00516.63
8.0.150.0170.00016.63
8.0.140.0000.01616.52
8.0.130.0110.00516.63
8.0.120.0140.00316.62
8.0.110.0150.00416.63
8.0.100.0130.00416.75
8.0.90.0050.01116.52
8.0.80.0100.00716.52
8.0.70.0140.00316.84
8.0.60.0110.00516.75
8.0.50.0130.00416.75
8.0.30.0100.00516.52
8.0.20.0120.00316.88
8.0.10.0090.00517.05

preferences:
58.96 ms | 403 KiB | 5 Q