3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "00 a 51 - a9b"; $numbers = ""; $chars = ""; preg_match_all("/(\d*)(\D*)/", $string, $matches); //print_r($matches); foreach($matches[1] as $match) { $numbers .= is_numeric($match) ? $match : ''; } foreach($matches[2] as $match) { $chars .= !is_numeric($match) ? $match : ''; } var_dump($numbers); echo " "; var_dump($chars);

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.0040.01118.52
8.3.50.0320.00521.34
8.3.40.0040.01118.79
8.3.30.0140.00020.29
8.3.20.0070.00020.38
8.3.10.0040.00420.92
8.3.00.0040.00422.51
8.2.180.0130.01016.63
8.2.170.0140.00022.96
8.2.160.0070.00722.43
8.2.150.0050.00224.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.97
8.2.110.0000.00919.32
8.2.100.0070.00318.16
8.2.90.0000.00819.22
8.2.80.0040.00419.38
8.2.70.0040.00417.88
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0060.00318.09
8.2.30.0030.00619.36
8.2.20.0040.00417.95
8.2.10.0000.00817.92
8.2.00.0030.00517.87
8.1.280.0060.01525.92
8.1.270.0080.00023.99
8.1.260.0230.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00322.54
8.1.230.0030.00920.91
8.1.220.0030.00618.77
8.1.210.0090.00020.82
8.1.200.0090.00017.38
8.1.190.0000.00817.28
8.1.180.0040.00418.10
8.1.170.0050.00318.84
8.1.160.0040.00418.95
8.1.150.0050.00218.84
8.1.140.0040.00417.59
8.1.130.0030.00317.91
8.1.120.0030.00617.54
8.1.110.0040.00417.50
8.1.100.0040.00417.63
8.1.90.0000.00817.53
8.1.80.0000.00717.53
8.1.70.0030.00317.57
8.1.60.0050.00317.73
8.1.50.0040.00417.75
8.1.40.0000.00717.64
8.1.30.0080.00017.76
8.1.20.0090.00017.86
8.1.10.0000.00717.71
8.1.00.0000.00817.68
8.0.300.0000.00720.21
8.0.290.0040.00417.28
8.0.280.0030.00318.37
8.0.270.0040.00417.32
8.0.260.0000.00717.06
8.0.250.0030.00317.09
8.0.240.0000.00817.27
8.0.230.0000.00717.18
8.0.220.0040.00417.17
8.0.210.0040.00417.11
8.0.200.0030.00317.14
8.0.190.0000.00717.27
8.0.180.0030.00717.18
8.0.170.0030.00617.13
8.0.160.0040.00417.15
8.0.150.0000.00817.05
8.0.140.0000.00716.98
8.0.130.0060.00013.59
8.0.120.0080.00016.98
8.0.110.0080.00017.12
8.0.100.0040.00417.05
8.0.90.0000.00717.18
8.0.80.0130.00317.12
8.0.70.0000.00717.16
8.0.60.0000.00716.94
8.0.50.0040.00416.98
8.0.30.0080.01517.27
8.0.20.0130.00617.42
8.0.10.0070.00017.25
8.0.00.0090.01117.01
7.4.330.0000.00516.86
7.4.320.0000.00616.85
7.4.300.0070.00016.73
7.4.290.0000.00716.80
7.4.280.0000.00716.78
7.4.270.0000.00816.82
7.4.260.0030.00313.43
7.4.250.0050.00216.70
7.4.240.0020.00516.84
7.4.230.0030.00616.91
7.4.220.0070.01116.77
7.4.210.0090.00716.73
7.4.200.0030.00316.74
7.4.190.0080.00016.93
7.4.160.0130.00316.80
7.4.150.0080.00817.40
7.4.140.0100.00717.86
7.4.130.0140.00516.83
7.4.120.0130.00316.55
7.4.110.0130.01016.84
7.4.100.0000.01916.71
7.4.90.0100.00716.77
7.4.80.0110.01119.39
7.4.70.0030.01616.75
7.4.60.0100.00716.62
7.4.50.0060.00316.52
7.4.40.0060.01022.77
7.4.30.0170.00016.54
7.4.00.0000.01415.05
7.3.330.0030.00313.41
7.3.320.0030.00313.33
7.3.310.0070.00016.33
7.3.300.0030.00316.46
7.3.290.0030.01016.39
7.3.280.0090.00916.44
7.3.270.0030.01717.40
7.3.260.0140.01018.24
7.3.250.0080.01016.73
7.3.240.0060.01216.45
7.3.230.0130.00616.75
7.3.210.0140.00516.66
7.3.200.0090.00919.39
7.3.190.0140.00716.63
7.3.180.0180.00516.54
7.3.170.0110.00516.45
7.3.160.0110.00616.72
7.3.120.0070.00714.96
7.2.330.0100.00816.91
7.2.320.0130.00716.91
7.2.310.0100.01316.92
7.2.300.0080.00816.74
7.2.290.0100.00616.86
7.2.00.0120.01219.24
7.1.100.0270.00717.71
7.1.70.0150.00317.30
7.1.60.0070.01119.17
7.1.50.0090.01216.89
7.1.00.0070.03022.50
7.0.200.0030.00716.97
7.0.140.0070.07021.97
7.0.60.0170.06019.93
7.0.50.0030.05017.66
7.0.40.0130.05720.23
7.0.30.0370.05020.02
7.0.20.0370.06720.31
7.0.10.0130.07020.21
7.0.00.0070.05720.34
5.6.280.0100.06720.89
5.6.210.0070.04020.66
5.6.200.0100.06318.08
5.6.190.0070.06720.39
5.6.180.0400.08320.39
5.6.170.0270.07720.42
5.6.160.0130.07720.38
5.6.150.0200.07018.22
5.6.140.0070.04018.09
5.6.130.0100.08018.10
5.6.120.0070.05321.12
5.6.110.0070.07720.98
5.6.100.0170.07720.97
5.6.90.0100.07021.12
5.6.80.0000.04320.48
5.5.350.0130.04020.30
5.5.340.0070.05317.91
5.5.330.0030.08320.25
5.5.320.0030.08720.24
5.5.310.0230.06720.23
5.5.300.0100.07717.91
5.5.290.0070.04317.98
5.5.280.0000.06320.68
5.5.270.0170.05320.64
5.5.260.0170.06320.95
5.5.250.0100.07720.68
5.5.240.0170.07020.23
5.4.450.0330.06319.41
5.4.440.0300.07719.11
5.4.430.0200.04319.38
5.4.420.0300.05319.45
5.4.410.0330.04319.36
5.4.400.0300.04018.89
5.4.390.0270.04718.79
5.4.380.0230.04719.21
5.4.370.0230.04719.16
5.4.360.0300.06719.25
5.4.350.0300.04019.06
5.4.340.0370.04719.09
5.4.320.0330.06718.88
5.4.310.0270.03719.08
5.4.300.0430.06319.21
5.4.290.0300.05719.25
5.4.280.0370.06018.90
5.4.270.0370.07019.25
5.4.260.0330.05719.21
5.4.250.0400.07019.15
5.4.240.0200.07318.91
5.4.230.0370.04719.13
5.4.220.0300.07718.88
5.4.210.0470.06019.09
5.4.200.0370.07018.89
5.4.190.0330.03719.23
5.4.180.0330.07318.92
5.4.170.0370.06719.13
5.4.160.0330.03719.11
5.4.150.0200.05318.86
5.4.140.0300.06716.37
5.4.130.0370.05016.53
5.4.120.0270.07716.44
5.4.110.0370.05016.45
5.4.100.0270.04016.49
5.4.90.0300.05016.34
5.4.80.0230.07016.18
5.4.70.0230.04016.37
5.4.60.0300.06316.32
5.4.50.0300.03316.36
5.4.40.0370.06716.36
5.4.30.0430.06016.36
5.4.20.0470.04716.16
5.4.10.0230.03716.38
5.4.00.0330.03315.79
5.3.290.0230.04314.73
5.3.280.0430.06314.45
5.3.270.0430.05714.46
5.3.260.0300.06714.46
5.3.250.0270.03714.55
5.3.240.0500.05014.54
5.3.230.0330.04714.69
5.3.220.0370.04314.59
5.3.210.0370.06314.50
5.3.200.0300.06014.43
5.3.190.0200.04314.44
5.3.180.0330.04014.42
5.3.170.0300.04014.61
5.3.160.0370.06714.65
5.3.150.0330.06314.50
5.3.140.0300.04314.43
5.3.130.0330.03314.50
5.3.120.0270.04014.59
5.3.110.0230.05014.49
5.3.100.0300.05714.13
5.3.90.0230.04314.00
5.3.80.0300.04013.81
5.3.70.0300.03013.94
5.3.60.0200.03713.84
5.3.50.0270.07313.78
5.3.40.0430.05013.90
5.3.30.0430.05313.85
5.3.20.0400.03313.53
5.3.10.0270.04713.50
5.3.00.0370.05713.49
5.2.170.0200.03011.16
5.2.160.0230.03011.16
5.2.150.0400.02311.09
5.2.140.0300.05011.08
5.2.130.0200.03011.15
5.2.120.0230.02311.01
5.2.110.0270.03010.94
5.2.100.0300.05010.94
5.2.90.0200.03311.11
5.2.80.0170.04010.98
5.2.70.0200.04710.98
5.2.60.0330.02310.98
5.2.50.0270.05711.06
5.2.40.0170.03310.84
5.2.30.0170.03010.91
5.2.20.0170.02710.86
5.2.10.0130.03310.96
5.2.00.0200.05310.62
5.1.60.0170.0309.96
5.1.50.0270.04310.08
5.1.40.0230.04010.13
5.1.30.0270.02010.23
5.1.20.0330.01710.50
5.1.10.0170.02310.12
5.1.00.0130.02710.08
5.0.50.0100.0208.41
5.0.40.0100.0178.50
5.0.30.0100.0378.20
5.0.20.0130.0208.43
5.0.10.0100.0208.11
5.0.00.0100.0308.24
4.4.90.0100.0177.63
4.4.80.0130.0307.63
4.4.70.0170.0177.63
4.4.60.0070.0207.63
4.4.50.0070.0207.63
4.4.40.0100.0507.63
4.4.30.0100.0377.63
4.4.20.0100.0177.63
4.4.10.0100.0207.63
4.4.00.0100.0207.63
4.3.110.0170.0137.63
4.3.100.0100.0207.63
4.3.90.0200.0237.63
4.3.80.0070.0307.63
4.3.70.0100.0307.63
4.3.60.0070.0277.63
4.3.50.0170.0137.63
4.3.40.0070.0377.63
4.3.30.0070.0137.63
4.3.20.0030.0177.63
4.3.10.0030.0307.63
4.3.00.0030.0177.63

preferences:
34.7 ms | 401 KiB | 5 Q