3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = '1-222-333-4545'; if (strlen($values) > 0 && !preg_match('/^[1]{0,1}-[0-9]{3}-[0-9]{3,4}-[0-9]{3,4}$/', $values)) { $err_msg[4] = ('Phone number must be in format xxx-nnnn-nnnn.'); echo $err_msg[4]; }

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.3.70.0090.00616.88
8.3.60.0110.00418.43
8.3.50.0120.00318.07
8.3.40.0150.00318.82
8.3.30.0110.00418.84
8.3.20.0070.00020.19
8.3.10.0000.00723.61
8.3.00.0040.00419.56
8.2.180.0000.01718.62
8.2.170.0000.02222.96
8.2.160.0070.00720.26
8.2.150.0030.00524.18
8.2.140.0000.00724.66
8.2.130.0030.00619.21
8.2.120.0070.00026.35
8.2.110.0070.00320.39
8.2.100.0000.01319.63
8.2.90.0050.00317.97
8.2.80.0000.00820.56
8.2.70.0030.00517.91
8.2.60.0080.00017.93
8.2.50.0050.00318.22
8.2.40.0040.00420.45
8.2.30.0040.00419.27
8.2.20.0050.00518.01
8.2.10.0040.00418.13
8.2.00.0070.00018.24
8.1.280.0070.00725.92
8.1.270.0070.00022.23
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0080.00023.83
8.1.230.0080.00821.04
8.1.220.0080.00017.74
8.1.210.0050.00318.96
8.1.200.0030.00617.48
8.1.190.0060.00317.63
8.1.180.0000.00718.10
8.1.170.0040.00418.83
8.1.160.0040.00418.91
8.1.150.0030.00320.24
8.1.140.0040.00417.82
8.1.130.0040.00418.95
8.1.120.0080.00017.63
8.1.110.0040.00417.55
8.1.100.0040.00417.65
8.1.90.0040.00417.64
8.1.80.0070.00017.60
8.1.70.0030.00617.55
8.1.60.0050.00317.74
8.1.50.0080.00017.59
8.1.40.0030.00517.55
8.1.30.0040.00417.64
8.1.20.0030.00517.82
8.1.10.0030.00517.56
8.1.00.0090.00017.63
8.0.300.0040.00420.07
8.0.290.0050.00216.75
8.0.280.0070.00018.39
8.0.270.0070.00017.27
8.0.260.0070.00016.84
8.0.250.0030.00617.14
8.0.240.0030.00716.99
8.0.230.0050.00517.09
8.0.220.0070.00017.13
8.0.210.0080.00017.03
8.0.200.0000.00817.10
8.0.190.0060.00317.09
8.0.180.0030.00516.93
8.0.170.0040.00416.89
8.0.160.0040.00416.93
8.0.150.0070.00016.96
8.0.140.0000.00817.05
8.0.130.0030.00313.40
8.0.120.0040.00416.97
8.0.110.0040.00417.06
8.0.100.0040.00416.86
8.0.90.0050.00316.97
8.0.80.0060.01616.98
8.0.70.0050.00216.89
8.0.60.0040.00417.14
8.0.50.0050.00216.96
8.0.30.0090.01017.29
8.0.20.0100.01117.40
8.0.10.0000.00717.11
8.0.00.0110.01016.76
7.4.330.0060.00015.55
7.4.320.0000.00616.81
7.4.300.0000.00616.82
7.4.290.0030.00316.77
7.4.280.0040.00416.64
7.4.270.0080.00016.70
7.4.260.0000.00816.68
7.4.250.0070.00316.28
7.4.240.0000.00716.71
7.4.230.0030.00316.55
7.4.220.0050.00316.87
7.4.210.0040.01116.86
7.4.200.0000.00716.71
7.4.160.0080.01016.66
7.4.150.0060.01317.40
7.4.140.0100.01017.86
7.4.130.0150.02216.87
7.4.120.0100.00916.72
7.4.110.0040.01816.63
7.4.100.0100.00616.61
7.4.90.0080.00816.78
7.4.80.0150.00619.39
7.4.70.0100.00716.51
7.4.60.0100.00616.64
7.4.50.0060.00616.66
7.4.40.0120.00616.89
7.4.00.0030.00715.27
7.3.330.0050.00013.21
7.3.320.0060.00013.21
7.3.310.0040.00416.39
7.3.300.0030.00316.32
7.3.290.0130.00616.52
7.3.280.0080.01116.35
7.3.270.0100.01017.40
7.3.260.0090.01016.44
7.3.250.0100.00616.45
7.3.240.0120.00816.65
7.3.230.0040.01316.69
7.3.210.0120.00416.55
7.3.200.0100.00716.57
7.3.190.0130.00916.35
7.3.180.0060.00916.59
7.3.170.0080.00816.73
7.3.160.0040.01116.40
7.2.330.0100.00616.78
7.2.320.0170.00716.83
7.2.310.0030.01416.80
7.2.300.0170.00016.63
7.2.290.0200.00316.68
7.2.60.0050.00617.09
7.2.20.0190.01117.98
7.2.10.0250.01317.74
7.2.00.0130.02118.07
7.1.200.0200.00615.70
7.1.140.0150.01717.00
7.1.130.0170.01617.25
7.1.120.0310.00317.11
7.1.110.0130.01516.56
7.1.100.0680.02016.44
7.1.90.0160.00516.26
7.1.80.0210.01616.41
7.1.70.0280.00615.61
7.1.60.0290.01633.29
7.1.50.0220.01832.88
7.1.40.0240.01832.82
7.1.30.0440.01032.74
7.1.20.0570.00933.01
7.1.10.0100.00814.98
7.1.00.0230.01515.08

preferences:
51.05 ms | 400 KiB | 5 Q