3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr_postcode_regexes = [ 'offshore' => [ ['A', 'B', '3', '[0-8]'], // AB30-38 ['A', 'B', '4', '[1-9]'], // AB41-49 ['A', 'B', '5', '[0-6]'], // AB50-56 ['F', 'K', '1', '[789]'], // FK17-19 ['F', 'K', '2', '[01]'], // FK20-21 ['G', '8', '3'], // G83 ['G', 'Y', '9'], // GY9 ['H', 'S', '[1-9]'], // HS1-9 ['I', 'M', '[0-9]', '[0-9A-Z]?'], // IM ['I', 'M', '[0-9]', '[0-9A-Z]?'], // IV ['K', 'A', '2', '[89]'], // KA27-28 ['K', 'W', '[0-9]', '[0-9]?'], // KW0-99 ['P', 'A', '[2-9]', '[0-9]'], // PA20-99 ['P', 'H', '1', '[5-9]'], // PH15-19 ['P', 'H', '[2-9]', '[0-9]'], // PH20-99 ['T', 'R', '2', '[1-5]'], // TR21-25 ['Z', 'E', '[0-9]', '[0-9A-Z]?'], // ZE ], 'ni' => [ ['B', 'T', '[0-9]', '[0-9A-Z]?'], // ZE ] ]; // Turn the readable-ish map above into actual regexes // It's important that all regexes match only full, valid postcodes, as prefix matching can be ambiguous. foreach ($arr_postcode_regexes as $str_id => $arr_parts) { $arr_temp = []; foreach ($arr_parts as $arr_part) { $arr_temp[] = implode('\s*', $arr_part) . '\s*[0-9]\s*[A-Z]\s*[A-Z]'; } $arr_postcode_regexes[$str_id] = '^\s*(' . implode('|', $arr_temp) . ')\s*$'; } var_dump($arr_postcode_regexes);

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.0110.00418.43
8.3.50.0130.00622.88
8.3.40.0110.01118.79
8.3.30.0030.01018.99
8.3.20.0080.00020.29
8.3.10.0040.00421.78
8.3.00.0040.00417.93
8.2.180.0180.00416.75
8.2.170.0070.01122.96
8.2.160.0040.01120.27
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.15
8.2.110.0070.00322.08
8.2.100.0040.00719.51
8.2.90.0040.00419.36
8.2.80.0030.00617.97
8.2.70.0070.00317.62
8.2.60.0050.00518.05
8.2.50.0040.00418.07
8.2.40.0050.00318.22
8.2.30.0040.00418.21
8.2.20.0070.00017.69
8.2.10.0070.00018.06
8.2.00.0030.00517.66
8.1.280.0000.01525.92
8.1.270.0000.00823.90
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.71
8.1.230.0120.00018.88
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0040.00417.38
8.1.180.0070.00018.10
8.1.170.0040.00418.70
8.1.160.0040.00422.06
8.1.150.0040.00418.88
8.1.140.0040.00417.43
8.1.130.0000.00717.77
8.1.120.0000.00817.50
8.1.110.0040.00417.34
8.1.100.0040.00417.41
8.1.90.0000.00917.43
8.1.80.0020.00517.48
8.1.70.0000.00717.39
8.1.60.0000.00817.57
8.1.50.0080.00017.44
8.1.40.0020.00517.43
8.1.30.0040.00417.70
8.1.20.0040.00417.52
8.1.10.0050.00317.58
8.1.00.0040.00417.41
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0030.00318.37
8.0.270.0040.00417.23
8.0.260.0000.00817.14
8.0.250.0030.00316.96
8.0.240.0050.00216.89
8.0.230.0040.00316.86
8.0.220.0050.00316.90
8.0.210.0030.00316.92
8.0.200.0030.00316.93
8.0.190.0050.00216.97
8.0.180.0040.00416.81
8.0.170.0060.00316.89
8.0.160.0000.00716.91
8.0.150.0030.00316.84
8.0.140.0000.00716.88
8.0.130.0060.00013.33
8.0.120.0030.00516.86
8.0.110.0000.00816.83
8.0.100.0000.00716.73
8.0.90.0030.00316.69
8.0.80.0040.01216.95
8.0.70.0040.00416.80
8.0.60.0000.00816.78
8.0.50.0040.00416.71
8.0.30.0130.00617.15
8.0.20.0130.00817.40
8.0.10.0000.00717.08
8.0.00.0150.00616.79
7.4.330.0000.00615.08
7.4.320.0000.00716.52
7.4.300.0040.00416.54
7.4.290.0040.00416.41
7.4.280.0040.00416.59
7.4.270.0000.00816.44
7.4.260.0070.00016.40
7.4.250.0030.00516.47
7.4.240.0000.00816.57
7.4.230.0000.00716.27
7.4.220.0070.01116.63
7.4.210.0110.00316.57
7.4.200.0050.00216.53
7.4.160.0100.00716.48
7.4.150.0120.01217.40
7.4.140.0080.01317.86
7.4.130.0110.00716.58
7.4.120.0140.00316.52
7.4.110.0140.00416.58
7.4.100.0070.01116.54
7.4.90.0070.01016.40
7.4.80.0120.01019.39
7.4.70.0100.00716.42
7.4.60.0110.00616.32
7.4.50.0040.00416.31
7.4.40.0180.00416.66
7.4.30.0080.00816.59
7.4.10.0090.00914.89
7.4.00.0070.00914.61
7.3.330.0070.00013.09
7.3.320.0020.00213.12
7.3.310.0030.00316.27
7.3.300.0000.00716.35
7.3.290.0000.01916.29
7.3.280.0080.00816.34
7.3.270.0180.00017.40
7.3.260.0140.00716.32
7.3.250.0100.00716.42
7.3.240.0030.01616.30
7.3.230.0160.00016.39
7.3.210.0080.00816.47
7.3.200.0060.01119.39
7.3.190.0030.01316.56
7.3.180.0030.01916.32
7.3.170.0130.00316.40
7.3.160.0060.00916.39
7.3.130.0100.00714.95
7.3.120.0050.00914.79
7.3.110.0120.00614.96
7.3.100.0060.00614.67
7.3.90.0070.00714.74
7.3.80.0100.00314.88
7.3.70.0000.01614.78
7.3.60.0100.00314.72
7.3.50.0090.00314.86
7.3.40.0030.00614.66
7.3.30.0030.01214.92
7.3.20.0060.01116.77
7.3.10.0000.00916.89
7.3.00.0060.00616.75
7.2.330.0140.00416.49
7.2.320.0080.00816.34
7.2.310.0080.00916.55
7.2.300.0060.01516.58
7.2.290.0130.00716.66
7.2.260.0060.01315.13
7.2.250.0140.00714.98
7.2.240.0030.01015.00
7.2.230.0070.01314.88
7.2.220.0030.01615.06
7.2.210.0000.01414.98
7.2.200.0000.01314.97
7.2.190.0070.00715.13
7.2.180.0040.00714.88
7.2.170.0030.00915.05
7.2.160.0100.00315.04
7.2.150.0030.01017.02
7.2.140.0040.00816.69
7.2.130.0060.00916.89
7.2.120.0100.00016.77
7.2.110.0060.00916.94
7.2.100.0080.00816.83
7.2.90.0000.01416.84
7.2.80.0000.01117.09
7.2.70.0000.01516.95
7.2.60.0030.01216.82
7.2.50.0060.00916.71
7.2.40.0000.01417.02
7.2.30.0040.00816.93
7.2.20.0100.00316.94
7.2.10.0000.01516.67
7.2.00.0060.01018.21
7.1.330.0040.01115.64
7.1.320.0040.01115.83
7.1.310.0040.01215.94
7.1.300.0030.01115.52
7.1.290.0070.00715.91
7.1.280.0040.00715.76
7.1.270.0060.00615.59
7.1.260.0070.00415.68
7.1.250.0090.00615.71
7.1.240.0000.01015.78
7.1.230.0000.01415.83
7.1.220.0000.01415.87
7.1.210.0100.00315.49
7.1.200.0130.00015.63
7.1.190.0070.01015.64
7.1.180.0070.00415.56
7.1.170.0030.01015.76
7.1.160.0030.00915.76
7.1.150.0100.00315.97
7.1.140.0060.00615.83
7.1.130.0000.00815.68
7.1.120.0090.00315.82
7.1.110.0070.00715.92
7.1.100.0100.00816.96
7.1.90.0030.01015.76
7.1.80.0060.00915.71
7.1.70.0020.01016.48
7.1.60.0100.00917.56
7.1.50.0050.01416.19
7.1.40.0030.00915.71
7.1.30.0070.00715.59
7.1.20.0060.00915.52
7.1.10.0000.00915.57
7.1.00.0070.04019.14
7.0.330.0030.00615.35
7.0.320.0120.00315.51
7.0.310.0040.00715.43
7.0.300.0000.01115.48
7.0.290.0040.00415.59
7.0.280.0070.01115.44
7.0.270.0030.00515.44
7.0.260.0090.00615.45
7.0.250.0080.00615.52
7.0.240.0030.01315.64
7.0.230.0030.01315.27
7.0.220.0030.01015.50
7.0.210.0040.01115.29
7.0.200.0040.00816.27
7.0.190.0090.00015.42
7.0.180.0030.01315.42
7.0.170.0000.01315.23
7.0.160.0040.01115.38
7.0.150.0090.00615.43
7.0.140.0050.04218.54
7.0.130.0030.01015.54
7.0.120.0040.00415.18
7.0.110.0000.01215.41
7.0.100.0030.00615.46
7.0.90.0030.01015.32
7.0.80.0050.00315.33
7.0.70.0070.00715.39
7.0.60.0120.01917.66
7.0.50.0150.03516.71
7.0.40.0070.04716.79
7.0.30.0220.02016.74
7.0.20.0180.03816.71
7.0.10.0030.02916.86
7.0.00.0070.02216.68
5.6.400.0100.00014.70
5.6.390.0000.01814.33
5.6.380.0000.01414.78
5.6.370.0060.00814.77
5.6.360.0030.01013.98
5.6.350.0060.00914.62
5.6.340.0080.01114.63
5.6.330.0080.00414.54
5.6.320.0140.00014.82
5.6.310.0030.00914.34
5.6.300.0070.00714.57
5.6.290.0030.00614.52
5.6.280.0060.05117.81
5.6.270.0000.01514.20
5.6.260.0040.00414.70
5.6.250.0000.01214.53
5.6.240.0130.00014.68
5.6.230.0060.00614.34
5.6.220.0030.01014.54
5.6.210.0120.03817.42
5.6.200.0120.04016.23
5.6.190.0080.04317.52
5.6.180.1960.02817.56
5.6.170.0170.03617.67
5.6.160.0120.01717.36
5.6.150.0050.04716.35
5.6.140.0020.02416.37
5.6.130.0070.04916.27
5.6.120.0070.03717.84
5.6.110.0060.03017.70
5.6.100.0100.02917.57
5.6.90.0040.02517.73
5.6.80.0070.04317.45
5.6.70.1920.02617.41
5.6.60.0030.01414.09
5.6.50.0090.00314.22
5.6.40.0080.00414.32
5.6.30.0090.00613.96
5.6.20.0090.00614.56
5.6.10.0030.00614.41
5.6.00.0130.00314.40
5.5.380.0070.00714.39
5.5.370.0070.00714.32
5.5.360.0090.00914.15
5.5.350.0140.03717.35
5.5.340.0070.04516.24
5.5.330.0070.04217.42
5.5.320.1210.02617.30
5.5.310.0100.02817.44
5.5.300.0030.02316.09
5.5.290.0070.04816.07
5.5.280.0020.05317.57
5.5.270.0020.02717.50
5.5.260.0020.02517.44
5.5.250.0080.03817.26
5.5.240.0130.03717.02
5.5.230.0060.01014.28
5.5.220.0060.00914.16
5.5.210.0070.00714.17
5.5.200.0040.00814.14
5.5.190.0000.01514.55
5.5.180.0060.00614.43
5.5.170.0100.00614.18
5.5.160.0120.00314.27
5.5.150.0070.00714.25
5.5.140.0090.00613.93
5.5.130.0030.00613.85
5.5.120.0130.00314.25
5.5.110.0100.00314.32
5.5.100.0040.00714.18
5.5.90.0080.00614.35
5.5.80.0000.01414.02
5.5.70.0070.00314.44
5.5.60.0100.00014.32
5.5.50.0030.00714.26
5.5.40.0030.00914.10
5.5.30.0000.00814.13
5.5.20.0030.01214.35
5.5.10.0000.01013.96
5.5.00.0040.01114.21
5.4.450.0090.02815.20
5.4.440.0130.02615.33
5.4.430.0250.02315.27
5.4.420.0270.02615.29
5.4.410.0180.02115.31
5.4.400.0180.02115.31
5.4.390.0280.02914.98
5.4.380.0210.02614.71
5.4.370.0200.02814.79
5.4.360.0150.03314.95
5.4.350.0170.03014.82
5.4.340.0200.03114.82
5.4.330.0030.00911.11
5.4.320.0050.02311.62
5.4.310.0060.02211.74
5.4.300.0050.02211.65
5.4.290.0060.02011.91
5.4.280.0070.02011.53
5.4.270.0050.01911.66
5.4.260.0080.02011.75
5.4.250.0060.02311.80
5.4.240.0050.02511.75
5.4.230.0030.03211.65
5.4.220.0060.02311.78
5.4.210.0030.02811.82
5.4.200.0050.02611.68
5.4.190.0040.02411.71
5.4.180.0070.02011.71
5.4.170.0050.02011.69
5.4.160.0050.02111.62
5.4.150.0060.02211.67
5.4.140.0040.02211.65
5.4.130.0050.01911.49
5.4.120.0050.02111.53
5.4.110.0050.02611.48
5.4.100.0050.02211.50
5.4.90.0040.02111.53
5.4.80.0050.02211.54
5.4.70.0030.02511.46
5.4.60.0070.02511.40
5.4.50.0060.02411.51
5.4.40.0080.02811.53
5.4.30.0080.02411.54
5.4.20.0090.02411.42
5.4.10.0090.01911.41
5.4.00.0060.02011.34
5.3.290.0090.02111.54
5.3.280.0050.02411.40
5.3.270.0100.02611.43
5.3.260.0070.02111.46
5.3.250.0060.02411.36
5.3.240.0070.02511.40
5.3.230.0040.02911.43
5.3.220.0030.02211.42
5.3.210.0060.02811.38
5.3.200.0070.01811.31
5.3.190.0080.02211.45
5.3.180.0050.02611.46
5.3.170.0080.02511.39
5.3.160.0110.01911.43
5.3.150.0050.02511.53
5.3.140.0070.02111.36
5.3.130.0080.02411.45
5.3.120.0060.02811.51
5.3.110.0040.02911.45
5.3.100.0060.02511.15
5.3.90.0040.03011.17
5.3.80.0080.01611.16
5.3.70.0070.02111.12
5.3.60.0060.02211.01
5.3.50.0060.02411.13
5.3.40.0050.02311.06
5.3.30.0070.03310.99
5.3.20.0070.02110.97
5.3.10.0050.02410.80
5.3.00.0090.02510.80
5.2.170.0080.0359.19
5.2.160.0080.0369.18
5.2.150.0060.0309.19
5.2.140.0040.0359.18
5.2.130.0050.0329.14
5.2.120.0030.0319.14
5.2.110.0090.0329.15
5.2.100.0060.0329.14
5.2.90.0050.0309.14
5.2.80.0050.0309.14
5.2.70.0050.0319.14
5.2.60.0060.0289.09
5.2.50.0040.0339.06
5.2.40.0060.0329.04
5.2.30.0100.0359.01
5.2.20.0090.0279.00
5.2.10.0070.0358.93
5.2.00.0070.0388.78
5.1.60.0030.0328.07
5.1.50.0070.0338.07
5.1.40.0040.0328.04
5.1.30.0070.0288.40
5.1.20.0070.0458.41
5.1.10.0040.0398.14
5.1.00.0070.0228.14
5.0.50.0070.0276.62
5.0.40.0040.0186.48
5.0.30.0060.0296.29
5.0.20.0030.0246.27
5.0.10.0070.0246.24
5.0.00.0040.0316.23
4.4.90.0030.0234.78
4.4.80.0030.0264.76
4.4.70.0060.0244.75
4.4.60.0040.0154.75
4.4.50.0050.0214.77
4.4.40.0040.0274.71
4.4.30.0060.0184.76
4.4.20.0010.0274.84
4.4.10.0020.0214.85
4.4.00.0040.0264.76
4.3.110.0000.0184.67
4.3.100.0040.0144.66
4.3.90.0010.0164.63
4.3.80.0030.0244.58
4.3.70.0010.0174.63
4.3.60.0070.0194.63
4.3.50.0030.0214.63
4.3.40.0050.0244.54
4.3.30.0030.0203.29
4.3.20.0030.0263.26
4.3.10.0100.0263.22
4.3.00.0130.01715.89

preferences:
45.37 ms | 401 KiB | 5 Q