3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "1A1R0A"; var_export(preg_match_all('~(\d)\K\D~', $string, $out) ? [$out[1], $out[0]] : [[], []]); echo "\n--- or ---\n"; [$letters, $numbers] = preg_match_all('~(\d)\K\D~', $string, $out) ? $out : [[], []]; var_export($numbers); echo "\n"; var_export($letters);

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.0130.00722.52
8.4.110.0120.00818.89
8.4.100.0060.00419.75
8.4.90.0130.00718.71
8.4.80.0050.00319.82
8.4.70.0130.00718.21
8.4.60.0130.00818.83
8.4.50.0100.00918.56
8.4.40.0140.00719.63
8.4.30.0170.00320.56
8.4.20.0160.00320.62
8.4.10.0030.00617.94
8.3.250.0100.00618.77
8.3.240.0070.00216.64
8.3.230.0090.01016.79
8.3.220.0080.01017.30
8.3.210.0150.00518.42
8.3.200.0060.00316.72
8.3.190.0080.01117.29
8.3.180.0080.01016.61
8.3.170.0150.00318.82
8.3.160.0030.00620.12
8.3.150.0140.00016.69
8.3.140.0140.00319.04
8.3.130.0080.00818.52
8.3.120.0040.00418.91
8.3.110.0060.00316.52
8.3.100.0100.00018.37
8.3.90.0070.00326.77
8.3.80.0040.00417.00
8.3.70.0180.00416.58
8.3.60.0100.00718.31
8.3.50.0070.01422.02
8.3.40.0150.00418.96
8.3.30.0150.00318.91
8.3.20.0070.00021.69
8.3.10.0000.00720.21
8.3.00.0080.00023.61
8.2.290.0120.00620.71
8.2.280.0080.01120.36
8.2.270.0040.00419.32
8.2.260.0040.00416.73
8.2.250.0080.00016.82
8.2.240.0030.00619.05
8.2.230.0080.00420.94
8.2.220.0090.00037.54
8.2.210.0000.00826.77
8.2.200.0060.00316.50
8.2.190.0070.01116.63
8.2.180.0120.00825.92
8.2.170.0170.00322.96
8.2.160.0070.00719.24
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0180.00026.16
8.2.110.0060.00322.20
8.2.100.0090.00318.03
8.2.90.0050.00518.00
8.2.80.0050.00319.03
8.2.70.0000.00817.88
8.2.60.0080.00417.78
8.2.50.0080.00018.10
8.2.40.0040.00421.23
8.2.30.0000.00719.34
8.2.20.0040.00418.23
8.2.10.0000.00819.41
8.2.00.0000.00719.35
8.1.330.0100.00922.04
8.1.320.0130.00716.14
8.1.310.0100.01018.60
8.1.300.0040.00416.67
8.1.290.0060.00330.84
8.1.280.0100.00625.92
8.1.270.0040.00423.98
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0100.00723.91
8.1.230.0000.01122.75
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0130.00417.11
8.1.190.0030.00617.35
8.1.180.0060.00318.10
8.1.170.0000.00818.68
8.1.160.0000.00918.93
8.1.150.0080.00318.98
8.1.140.0000.00722.10
8.1.130.0030.00320.18
8.1.120.0000.01017.65
8.1.110.0000.00817.64
8.1.100.0070.00017.63
8.1.90.0040.00417.53
8.1.80.0070.00017.65
8.1.70.0000.00817.67
8.1.60.0030.00617.70
8.1.50.0080.00017.74
8.1.40.0030.00617.71
8.1.30.0040.00717.80
8.1.20.0030.00617.82
8.1.10.0040.00417.78
8.1.00.0030.00517.72
8.0.300.0040.00418.77
8.0.290.0070.00017.00
8.0.280.0000.00718.55
8.0.270.0030.00317.29
8.0.260.0030.00320.11
8.0.250.0060.00317.10
8.0.240.0030.00317.16
8.0.230.0000.00716.98
8.0.220.0070.00017.06
8.0.210.0030.00316.91
8.0.200.0000.00616.98
8.0.190.0040.00417.00
8.0.180.0000.00817.02
8.0.170.0040.00417.08
8.0.160.0000.00817.03
8.0.150.0040.00417.09
8.0.140.0000.00716.99
8.0.130.0000.00713.56
8.0.120.0000.00716.89
8.0.110.0040.00417.04
8.0.100.0000.00717.03
8.0.90.0050.00316.90
8.0.80.0160.00617.01
8.0.70.0050.00217.00
8.0.60.0000.00716.90
8.0.50.0030.00516.93
8.0.30.0120.00617.10
8.0.20.0110.00817.07
8.0.10.0000.00817.05
8.0.00.0120.01317.07
7.4.330.0000.00515.55
7.4.320.0030.00316.74
7.4.300.0050.00216.67
7.4.290.0000.00716.71
7.4.280.0040.00416.77
7.4.270.0080.00016.73
7.4.260.0070.00016.66
7.4.250.0030.00316.65
7.4.240.0020.00616.83
7.4.230.0070.00016.90
7.4.220.0050.00216.77
7.4.210.0110.00616.84
7.4.200.0000.00716.64
7.4.140.0070.01017.86
7.4.130.0110.00816.86
7.4.120.0110.01116.75
7.4.110.0030.01316.78
7.4.100.0040.01516.75
7.4.90.0080.00816.76
7.4.80.0090.00919.39
7.4.70.0030.01616.66
7.4.60.0100.00616.67
7.4.50.0030.01316.80
7.4.40.0060.01016.61
7.4.00.0030.01415.28
7.3.330.0000.00613.34
7.3.320.0060.00013.26
7.3.310.0070.00016.32
7.3.300.0040.00416.41
7.3.290.0030.00316.46
7.3.280.0050.01016.36
7.3.260.0110.00716.55
7.3.240.0100.00716.51
7.3.230.0070.01316.55
7.3.210.0120.00616.68
7.3.200.0130.00316.45
7.3.190.0160.00716.78
7.3.180.0070.01116.60
7.3.170.0130.00316.57
7.3.160.0100.00616.79
7.3.70.0040.01314.76
7.3.60.0070.01014.86
7.3.50.0080.00814.66
7.3.40.0050.01014.95
7.3.30.0110.00514.23
7.3.20.0100.00714.74
7.3.10.0250.01614.89
7.3.00.0120.00314.94
7.2.330.0090.00916.80
7.2.320.0060.01016.63
7.2.310.0070.01116.70
7.2.300.0030.01516.87
7.2.290.0000.01716.87
7.2.200.0200.00014.93
7.2.190.0140.00414.97
7.2.180.0140.00514.73
7.2.170.0120.00315.12
7.2.160.0070.00715.21
7.2.150.0160.00415.16
7.2.140.0130.00615.04
7.2.130.0140.01015.01
7.2.120.0170.00715.14
7.2.110.0090.00915.06
7.2.100.0630.00615.00
7.2.90.0030.01414.79
7.2.80.0130.00614.83
7.2.70.0160.00915.11
7.2.60.0160.00315.07
7.2.50.0140.01015.28
7.2.40.0150.00615.07
7.2.30.0090.01315.08
7.2.20.0100.01015.04
7.2.10.0100.00715.22
7.2.00.0090.00915.04
7.1.300.0140.00414.06
7.1.290.0130.00313.80
7.1.280.0090.01014.11
7.1.270.0070.00713.85
7.1.260.0100.00714.03
7.1.250.0060.00914.09

preferences:
28.19 ms | 403 KiB | 5 Q