3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nationalNumber = "4732691234"; $nationalNumberPattern = '[4589]\d{9}'; $final_pattern = '(?:' . $nationalNumberPattern . ')'; $final_pattern = '^' . $final_pattern . '$'; $final_pattern = '/' . $final_pattern . '/x'; $b = (preg_match($final_pattern, $nationalNumber, $groups, PREG_OFFSET_CAPTURE) == 1) ? true : false; var_dump($final_pattern, $nationalNumber, $b, $groups); var_dump(PCRE_VERSION);

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.60.0060.00918.68
8.3.50.0140.00718.33
8.3.40.0070.01018.79
8.3.30.0120.00319.10
8.3.20.0070.00020.35
8.3.10.0040.00421.76
8.3.00.0080.00019.40
8.2.180.0110.00716.63
8.2.170.0140.00722.96
8.2.160.0110.00420.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00622.10
8.2.110.0000.00922.23
8.2.100.0120.00017.75
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0080.00017.93
8.2.50.0030.00618.07
8.2.40.0040.00419.75
8.2.30.0000.00718.14
8.2.20.0070.00017.79
8.2.10.0040.00418.05
8.2.00.0040.00417.77
8.1.270.0100.01022.19
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.98
8.1.230.0070.00419.26
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0050.00317.35
8.1.180.0060.00318.10
8.1.170.0050.00318.63
8.1.160.0050.00322.04
8.1.150.0040.00418.91
8.1.140.0080.00017.60
8.1.130.0070.00017.73
8.1.120.0030.00317.63
8.1.110.0060.00317.61
8.1.100.0050.00317.50
8.1.90.0070.00017.61
8.1.80.0050.00317.51
8.1.70.0030.00317.50
8.1.60.0060.00317.72
8.1.50.0050.00317.74
8.1.40.0050.00217.56
8.1.30.0050.00317.85
8.1.20.0020.00517.71
8.1.10.0070.00017.67
8.1.00.0080.00017.60
8.0.300.0070.00018.77
8.0.290.0000.00716.88
8.0.280.0000.00718.38
8.0.270.0000.00817.28
8.0.260.0000.00617.28
8.0.250.0030.00317.16
8.0.240.0050.00317.06
8.0.230.0030.00317.02
8.0.220.0030.00317.00
8.0.210.0000.00716.98
8.0.200.0040.00417.01
8.0.190.0070.00017.09
8.0.180.0070.00017.13
8.0.170.0040.00416.99
8.0.160.0040.00717.09
8.0.150.0000.01016.88
8.0.140.0040.00416.95
8.0.130.0000.00613.43
8.0.120.0040.00416.92
8.0.110.0050.00317.02
8.0.100.0000.00816.83
8.0.90.0000.00717.07
8.0.80.0130.01017.00
8.0.70.0050.00217.08
8.0.60.0070.00017.03
8.0.50.0040.00416.83
8.0.30.0130.00917.23
8.0.20.0140.00717.43
8.0.10.0080.00017.18
8.0.00.0090.00816.85
7.4.330.0050.00015.17
7.4.320.0070.00016.86
7.4.300.0000.00716.70
7.4.290.0050.00216.71
7.4.280.0050.00316.85
7.4.270.0000.00616.71
7.4.260.0030.00316.74
7.4.250.0040.00416.59
7.4.240.0060.00116.84
7.4.230.0030.00316.62
7.4.220.0090.00916.82
7.4.210.0150.00316.66
7.4.200.0000.00716.81
7.4.160.0060.00916.54
7.4.150.0070.01017.40
7.4.140.0160.00517.86
7.4.130.0070.01316.73
7.4.120.0090.01116.63
7.4.110.0140.00316.61
7.4.100.0110.00616.66
7.4.90.0120.00616.71
7.4.80.0140.01416.44
7.4.60.0150.00316.66
7.4.50.0000.00516.47
7.4.00.0040.01115.27
7.3.330.0030.00313.20
7.3.320.0070.00013.27
7.3.310.0020.00516.41
7.3.300.0000.00716.45
7.3.290.0130.00716.38
7.3.280.0070.00916.38
7.3.270.0120.00617.40
7.3.260.0070.01016.67
7.3.250.0110.00616.67
7.3.240.0120.00616.64
7.3.230.0160.00716.71
7.3.210.0130.00916.82
7.3.200.0130.00616.43
7.3.180.0070.00716.36
7.3.10.0060.00916.60
7.3.00.0090.00616.83
7.2.330.0110.00816.85
7.2.320.0090.01316.74
7.2.130.0060.00616.82
7.2.120.0030.01017.09
7.2.110.0040.01117.07
7.2.100.0060.00916.92
7.2.90.0030.01316.86
7.2.80.0070.00816.82
7.2.70.0100.00317.01
7.2.60.0060.00616.91
7.2.50.0000.01416.85
7.2.40.0030.01316.96
7.2.30.0030.01216.84
7.2.20.0060.01017.09
7.2.10.0070.00716.98
7.2.00.0030.01218.40
7.1.250.0060.00916.06
7.1.200.0040.01215.99
7.1.100.0030.00917.91
7.1.70.0030.00617.43
7.1.60.0040.02119.32
7.1.50.0090.00917.05
7.1.00.0130.06722.47
7.0.200.0030.00516.86
7.0.140.0070.07022.04
7.0.60.0100.08019.89
7.0.50.0030.06017.80
7.0.40.0070.06319.98
7.0.30.0300.04720.19
7.0.20.0130.05020.05
7.0.10.0070.09020.01
7.0.00.0070.08020.36
5.6.280.0130.06021.02
5.6.210.0100.06320.72
5.6.200.0130.04018.22
5.6.190.0000.06320.41
5.6.180.0200.05320.61
5.6.170.0370.07320.49
5.6.160.0100.08020.41
5.6.150.0130.08018.19
5.6.140.0100.05018.11
5.6.130.0000.05718.16
5.6.120.0070.07320.93
5.6.110.0100.07021.14
5.6.100.0030.05021.13
5.6.90.0000.04720.88
5.6.80.0130.03720.43
5.5.350.0100.04320.32
5.5.340.0030.04018.02
5.5.330.0170.07720.40
5.5.320.0430.04320.18
5.5.310.0230.08020.41
5.5.300.0100.07717.97
5.5.290.0030.08318.02
5.5.280.0130.07720.64
5.5.270.0170.06720.78
5.5.260.0130.07720.86
5.5.250.0030.05720.68
5.5.240.0300.06720.11
5.4.450.0970.06319.63
5.4.440.0900.05019.46
5.4.430.1030.06019.23
5.4.420.0930.00019.48
5.4.410.0630.00019.36
5.4.400.0600.00019.22
5.4.390.0630.00019.07
5.4.380.0770.00019.18
5.4.370.0630.00018.95
5.4.360.0600.00019.13
5.4.350.0630.00019.07
5.4.340.0060.03611.97
5.4.320.0060.03612.46
5.4.310.0040.03912.45
5.4.300.0080.03612.46
5.4.290.0080.03612.46
5.4.280.0030.03712.35
5.4.270.0080.04112.35
5.4.260.0060.03612.35
5.4.250.0060.03612.35
5.4.240.0040.03712.35
5.4.230.0090.03412.34
5.4.220.0100.03612.34
5.4.210.0040.03912.34
5.4.200.0050.03912.34
5.4.190.0050.03812.34
5.4.180.0050.03712.34
5.4.170.0050.03712.35
5.4.160.0060.03612.34
5.4.150.0030.03712.34
5.4.140.0050.03612.02
5.4.130.0050.03612.01
5.4.120.0030.04411.97
5.4.110.0060.03511.96
5.4.100.0040.03611.97
5.4.90.0080.04711.97
5.4.80.0080.04211.96
5.4.70.0060.03411.96
5.4.60.0040.03511.97
5.4.50.0040.03611.96
5.4.40.0080.03111.95
5.4.30.0050.03511.95
5.4.20.0040.03711.95
5.4.10.0040.03611.95
5.4.00.0050.03911.44
5.3.290.0060.03812.80
5.3.280.0050.03812.71
5.3.270.0090.03512.73
5.3.260.0040.04112.71
5.3.250.0070.05012.72
5.3.240.0080.03812.72
5.3.230.0070.03812.71
5.3.220.0070.04012.68
5.3.210.0060.04012.68
5.3.200.0070.03612.68
5.3.190.0060.03812.68
5.3.180.0060.03512.67
5.3.170.0080.04512.67
5.3.160.0090.03912.67
5.3.150.0050.03712.67
5.3.140.0050.04312.66
5.3.130.0040.04012.66
5.3.120.0080.04112.66
5.3.110.0110.04112.66
5.3.100.0060.03712.12
5.3.90.0080.03512.09
5.3.80.0040.03812.07
5.3.70.0040.03812.07
5.3.60.0070.04112.06
5.3.50.0070.03512.00
5.3.40.0060.03612.00
5.3.30.0050.03611.96
5.3.20.0060.03511.73
5.3.10.0040.03511.70
5.3.00.0050.03611.68
5.2.170.0060.0289.18
5.2.160.0070.0299.19
5.2.150.0060.0289.19
5.2.140.0010.0349.18
5.2.130.0050.0289.15
5.2.120.0040.0289.14
5.2.110.0010.0329.16
5.2.100.0040.0289.15
5.2.90.0040.0299.15
5.2.80.0020.0339.14
5.2.70.0030.0309.14
5.2.60.0060.0309.10
5.2.50.0040.0309.07
5.2.40.0050.0289.04
5.2.30.0040.0359.02
5.2.20.0030.0299.02
5.2.10.0040.0298.92
5.2.00.0040.0288.78
5.1.60.0040.0238.07
5.1.50.0030.0258.06
5.1.40.0040.0258.04
5.1.30.0040.0258.39
5.1.20.0030.0278.41
5.1.10.0050.0278.14
5.1.00.0030.0288.14
5.0.50.0050.0226.62
5.0.40.0050.0186.48
5.0.30.0030.0376.28
5.0.20.0030.0206.26
5.0.10.0050.0186.24
5.0.00.0020.0376.23
4.4.90.0050.0204.78
4.4.80.0040.0144.75
4.4.70.0050.0224.76
4.4.60.0020.0194.75
4.4.50.0020.0164.77
4.4.40.0020.0254.71
4.4.30.0010.0164.76
4.4.20.0010.0174.84
4.4.10.0030.0174.85
4.4.00.0040.0234.76
4.3.110.0030.0144.67
4.3.100.0080.0174.66
4.3.90.0020.0214.63
4.3.80.0040.0334.58
4.3.70.0030.0174.63
4.3.60.0030.0144.63
4.3.50.0020.0164.63
4.3.40.0020.0264.54
4.3.30.0010.0173.28
4.3.20.0020.0163.26
4.3.10.0040.0223.22
4.3.00.0070.0237.20

preferences:
67.48 ms | 400 KiB | 5 Q