3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "00 a 51 - a9b!_ "; function splitNumsFromChars($haystack) { // yes this is litteraly what it does. the function name says it all. hahahahhaaha :)))) $numbers = ""; // init $chars = ""; // init preg_match_all("/(\d*)(\D*)/", $haystack, $matches); foreach($matches[1] as $match) { $numbers .= is_numeric($match) ? $match : ''; } foreach($matches[2] as $match) { $chars .= !is_numeric($match) ? $match : ''; } $return['numbers'] = $numbers; $return['chars'] = $chars; return $return; } var_dump(splitNumsFromChars($string));

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.00718.68
8.3.50.0140.01121.33
8.3.40.0120.00319.13
8.3.30.0070.00720.34
8.3.20.0080.00020.33
8.3.10.0000.00821.12
8.3.00.0000.00822.58
8.2.180.0070.01016.75
8.2.170.0040.01122.96
8.2.160.0100.00322.21
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00421.11
8.2.110.0000.00919.31
8.2.100.0040.00818.09
8.2.90.0040.00419.17
8.2.80.0040.00419.35
8.2.70.0080.00017.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0040.00417.96
8.2.30.0000.00819.53
8.2.20.0040.00417.96
8.2.10.0070.00017.90
8.2.00.0050.00217.96
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0090.00626.35
8.1.250.0040.00428.09
8.1.240.0000.01022.56
8.1.230.0080.00420.87
8.1.220.0060.00318.77
8.1.210.0030.00520.79
8.1.200.0060.00317.35
8.1.190.0000.00917.52
8.1.180.0040.00418.10
8.1.170.0090.00018.78
8.1.160.0000.00718.80
8.1.150.0040.00418.71
8.1.140.0000.00917.53
8.1.130.0070.00017.78
8.1.120.0030.00617.66
8.1.110.0040.00417.59
8.1.100.0050.00317.60
8.1.90.0050.00217.63
8.1.80.0040.00417.50
8.1.70.0000.00717.51
8.1.60.0030.00617.68
8.1.50.0000.00817.71
8.1.40.0000.00717.71
8.1.30.0030.00517.62
8.1.20.0000.00917.88
8.1.10.0080.00017.62
8.1.00.0000.00817.68
8.0.300.0050.00220.03
8.0.290.0000.00817.04
8.0.280.0070.00018.34
8.0.270.0040.00417.20
8.0.260.0080.00017.03
8.0.250.0070.00017.11
8.0.240.0040.00417.13
8.0.230.0000.00717.14
8.0.220.0040.00417.11
8.0.210.0050.00217.01
8.0.200.0040.00417.13
8.0.190.0080.00017.23
8.0.180.0070.00417.14
8.0.170.0000.00817.16
8.0.160.0040.00416.99
8.0.150.0070.00017.08
8.0.140.0070.00016.93
8.0.130.0030.00313.51
8.0.120.0080.00016.97
8.0.110.0000.00817.17
8.0.100.0000.00717.05
8.0.90.0050.00217.10
8.0.80.0060.01017.09
8.0.70.0060.00317.14
8.0.60.0030.00517.13
8.0.50.0080.00016.96
8.0.30.0130.00817.18
8.0.20.0160.00717.40
8.0.10.0000.00816.98
8.0.00.0120.00916.81
7.4.330.0000.00516.71
7.4.320.0000.00716.86
7.4.300.0000.00716.82
7.4.290.0000.00716.70
7.4.280.0000.00816.85
7.4.270.0000.00716.64
7.4.260.0030.00313.43
7.4.250.0030.00516.67
7.4.240.0040.00416.80
7.4.230.0030.00416.54
7.4.220.0170.01016.75
7.4.210.0060.00816.78
7.4.200.0030.00316.91
7.4.190.0000.00716.89
7.4.160.0090.00616.43
7.4.150.0130.00617.40
7.4.140.0120.00417.86
7.4.130.0100.00816.75
7.4.120.0090.00816.71
7.4.110.0090.00916.77
7.4.100.0100.01416.74
7.4.90.0100.00716.66
7.4.80.0120.00719.39
7.4.70.0120.00416.70
7.4.60.0110.00616.63
7.4.50.0030.00516.61
7.4.40.0080.00422.77
7.4.30.0080.00816.89
7.4.10.0030.01215.15
7.4.00.0070.00914.94
7.3.330.0030.00313.56
7.3.320.0000.00513.60
7.3.310.0000.00816.56
7.3.300.0040.00416.62
7.3.290.0050.00816.58
7.3.280.0060.01116.60
7.3.270.0120.00917.40
7.3.260.0160.00918.24
7.3.250.0060.01116.65
7.3.240.0130.00516.54
7.3.230.0100.00716.63
7.3.210.0090.00916.80
7.3.200.0080.01719.39
7.3.190.0160.00616.54
7.3.180.0060.00916.69
7.3.170.0190.00316.64
7.3.160.0100.00916.89
7.3.130.0070.01114.98
7.3.120.0060.00915.00
7.3.110.0080.00315.04
7.3.100.0060.00615.00
7.3.90.0040.01515.02
7.3.80.0090.00614.99
7.3.70.0000.01014.77
7.3.60.0060.01014.79
7.3.50.0040.01514.88
7.3.40.0090.00314.86
7.3.30.0030.01015.08
7.3.20.0100.00316.90
7.3.10.0060.00316.61
7.3.00.0060.00617.00
7.2.330.0120.00617.00
7.2.320.0140.00916.77
7.2.310.0150.00416.97
7.2.300.0090.01416.96
7.2.290.0060.01016.74
7.2.260.0110.00715.23
7.2.250.0130.00315.21
7.2.240.0030.01415.20
7.2.230.0110.01115.00
7.2.220.0040.01115.37
7.2.210.0120.00015.24
7.2.200.0070.00715.34
7.2.190.0100.01015.29
7.2.180.0060.01315.16
7.2.170.0100.00615.34
7.2.160.0030.01015.30
7.2.150.0000.01617.39
7.2.140.0090.00617.03
7.2.130.0030.01316.93
7.2.120.0130.00317.08
7.2.110.0100.00016.98
7.2.100.0000.01317.13
7.2.90.0090.00616.97
7.2.80.0070.00717.19
7.2.70.0030.01417.00
7.2.60.0030.01217.23
7.2.50.0000.01417.25
7.2.40.0070.00717.08
7.2.30.0040.01517.07
7.2.20.0070.01017.25
7.2.10.0070.00717.29
7.2.00.0020.01018.07
7.1.330.0100.00616.14
7.1.320.0130.00315.83
7.1.310.0060.00616.26
7.1.300.0070.00715.87
7.1.290.0030.00915.77
7.1.280.0060.00616.18
7.1.270.0130.00015.89
7.1.260.0060.00316.13
7.1.250.0070.01116.16
7.1.240.0040.00415.73
7.1.230.0040.01116.14
7.1.220.0060.00616.13
7.1.210.0030.01215.92
7.1.200.0050.00915.92
7.1.190.0070.00716.10
7.1.180.0060.00616.18
7.1.170.0070.00715.66
7.1.160.0070.00715.70
7.1.150.0090.00615.71
7.1.140.0090.00615.92
7.1.130.0000.01216.01
7.1.120.0060.00316.11
7.1.110.0070.01115.96
7.1.100.0200.00716.93
7.1.90.0000.01415.86
7.1.80.0090.00315.86
7.1.70.0090.00516.54
7.1.60.0090.01217.56
7.1.50.0080.01016.72
7.1.40.0070.00715.75
7.1.30.0070.00715.83
7.1.20.0060.00315.96
7.1.10.0070.00715.84
7.1.00.0050.02219.27
7.0.330.0030.01315.82
7.0.320.0070.00715.35
7.0.310.0060.00615.55
7.0.300.0060.00915.60
7.0.290.0060.00615.77
7.0.280.0060.00615.71
7.0.270.0030.00715.51
7.0.260.0030.00615.47
7.0.250.0040.01115.40
7.0.240.0070.01015.75
7.0.230.0030.01515.78
7.0.220.0040.00415.65
7.0.210.0080.00415.47
7.0.200.0060.00516.21
7.0.190.0090.00615.78
7.0.180.0090.00615.68
7.0.170.0030.00815.48
7.0.160.0000.01415.62
7.0.150.0100.00315.82
7.0.140.0050.04218.80
7.0.130.0040.01215.43
7.0.120.0060.00615.49
7.0.110.0030.01015.79
7.0.100.0020.02517.79
7.0.90.0130.04417.86
7.0.80.0040.03217.80
7.0.70.0060.04317.71
7.0.60.0080.02717.54
7.0.50.0020.02517.90
7.0.40.0080.04016.80
7.0.30.0060.02516.85
7.0.20.0020.02516.86
7.0.10.0070.04216.90
7.0.00.0120.03216.90
5.6.400.0000.01114.78
5.6.390.0100.00714.68
5.6.380.0000.01114.64
5.6.370.0100.00314.30
5.6.360.0040.00814.89
5.6.350.0070.00714.64
5.6.340.0070.00714.78
5.6.330.0000.01314.49
5.6.320.0140.00314.56
5.6.310.0000.01414.46
5.6.300.0090.00614.23
5.6.290.0100.00714.26
5.6.280.0030.04217.96
5.6.270.0060.00914.30
5.6.260.0100.00714.48
5.6.250.0050.02517.63
5.6.240.0030.02017.66
5.6.230.0020.02517.53
5.6.220.0050.02317.54
5.6.210.0050.04717.62
5.6.200.0060.03817.73
5.6.190.0070.04617.91
5.6.180.0100.03717.73
5.6.170.0050.04617.78
5.6.160.0030.04217.83
5.6.150.0080.04217.79
5.6.140.0070.04517.88
5.6.130.0100.04217.88
5.6.120.0020.04617.91
5.6.110.0080.03917.84
5.6.100.0050.03517.76
5.6.90.0050.04817.79
5.6.80.0080.02617.45
5.6.70.0050.03017.40
5.6.60.0050.03217.34
5.6.50.0090.02917.32
5.6.40.0070.03917.33
5.6.30.0100.02317.43
5.6.20.0080.04317.44
5.6.10.0070.02617.43
5.6.00.0070.04417.40
5.5.380.0010.02417.46
5.5.370.0030.02417.58
5.5.360.0030.02417.37
5.5.350.0070.02317.35
5.5.340.0060.02317.55
5.5.330.0080.02717.62
5.5.320.0070.03517.44
5.5.310.0050.03317.64
5.5.300.0030.02617.72
5.5.290.0020.02817.59
5.5.280.0070.04417.47
5.5.270.0070.03217.74
5.5.260.0040.04617.74
5.5.250.0070.04517.55
5.5.240.0020.04117.29
5.5.230.0040.04417.19
5.5.220.0090.03917.46
5.5.210.0110.03817.17
5.5.200.0080.03317.18
5.5.190.0070.04517.23
5.5.180.0050.04517.39
5.5.170.0090.00614.46
5.5.160.0110.03817.22
5.5.150.0100.02317.28
5.5.140.0080.04017.36
5.5.130.0090.03717.25
5.5.120.0100.04017.20
5.5.110.0040.02917.45
5.5.100.0100.03717.24
5.5.90.0100.04217.03
5.5.80.0060.02817.31
5.5.70.0080.04217.33
5.5.60.0070.02817.07
5.5.50.0060.02817.24
5.5.40.0090.03317.21
5.5.30.0110.02517.13
5.5.20.0100.02517.29
5.5.10.0050.02417.22
5.5.00.0050.04017.16
5.4.450.0080.04115.44
5.4.440.0060.04115.26
5.4.430.0030.03015.20
5.4.420.0050.03315.51
5.4.410.0100.03715.24
5.4.400.0050.02314.99
5.4.390.0050.02315.15
5.4.380.0090.04114.98
5.4.370.0000.04115.25
5.4.360.0050.04314.88
5.4.350.0050.02615.05
5.4.340.0020.03015.23
5.4.330.0100.00311.19
5.4.320.0070.04015.17
5.4.310.0080.04115.05
5.4.300.0070.04515.18
5.4.290.0070.04215.02
5.4.280.0030.02215.13
5.4.270.0040.04415.23
5.4.260.0020.03915.10
5.4.250.0020.04315.07
5.4.240.0070.02215.13
5.4.230.0080.03515.17
5.4.220.0080.03314.97
5.4.210.0050.02515.06
5.4.200.0060.04215.12
5.4.190.0030.03814.96
5.4.180.0090.02115.21
5.4.170.0050.03315.13
5.4.160.0070.02815.20
5.4.150.0060.02815.20
5.4.140.0020.04413.95
5.4.130.0030.03813.79
5.4.120.0040.02013.75
5.4.110.0100.01713.84
5.4.100.0020.04013.77
5.4.90.0050.02813.79
5.4.80.0050.04013.76
5.4.70.0100.03213.64
5.4.60.0060.03113.76
5.4.50.0050.02213.93
5.4.40.0130.01813.91
5.4.30.0000.02813.74
5.4.20.0100.02313.82
5.4.10.0030.03713.75
5.4.00.0020.02613.49
5.3.290.0110.04013.19
5.3.280.0060.02513.12
5.3.270.0030.02213.14
5.3.260.0020.03113.15
5.3.250.0030.03513.18
5.3.240.0100.02413.10
5.3.230.0070.04013.01
5.3.220.0000.02813.10
5.3.210.0070.04013.13
5.3.200.0050.03713.12
5.3.190.0080.02313.15
5.3.180.0050.03213.19
5.3.170.0020.02713.21
5.3.160.0110.03613.12
5.3.150.0050.02313.12
5.3.140.0020.02513.09
5.3.130.0030.02713.17
5.3.120.0050.02013.04
5.3.110.0030.02813.17
5.3.100.0050.04013.04
5.3.90.0030.02313.14
5.3.80.0050.03313.11
5.3.70.0090.03513.07
5.3.60.0050.03413.14
5.3.50.0050.03812.92
5.3.40.0150.02813.08
5.3.30.0070.03313.09
5.3.20.0050.02813.09
5.3.10.0060.03012.94
5.3.00.0090.03212.99
5.2.170.0100.06015.57
5.2.160.0070.05015.57
5.2.150.0130.02015.57
5.2.140.0070.06315.57
5.2.130.0030.04015.57
5.2.120.0070.04715.57
5.2.110.0000.06315.57
5.2.100.0030.06015.57
5.2.90.0070.05715.57
5.2.80.0030.06315.57
5.2.70.0070.04715.57
5.2.60.0100.02715.57
5.2.50.0030.05015.57
5.2.40.0030.02715.57
5.2.30.0030.06015.57
5.2.20.0030.03315.57
5.2.10.0100.05715.57
5.2.00.0030.06715.57
5.1.60.0000.05715.57
5.1.50.0030.05015.57
5.1.40.0030.02715.57
5.1.30.0030.03015.57
5.1.20.0030.03715.57
5.1.10.0000.05315.57
5.1.00.0030.03715.57
5.0.50.0030.03315.57
5.0.40.0030.02715.57
5.0.30.0000.06015.57
5.0.20.0100.01315.57
5.0.10.0030.03315.57
5.0.00.0030.06015.57
4.4.90.0070.02015.57
4.4.80.0100.02715.57
4.4.70.0000.01715.57
4.4.60.0070.03315.57
4.4.50.0000.04015.57
4.4.40.0030.04715.57
4.4.30.0000.03715.57
4.4.20.0000.03715.57
4.4.10.0000.01715.57
4.4.00.0000.05315.57
4.3.110.0070.03315.57
4.3.100.0000.03015.57
4.3.90.0030.02015.57
4.3.80.0000.03015.57
4.3.70.0000.03715.57
4.3.60.0000.02315.57
4.3.50.0070.03015.57
4.3.40.0000.02715.57
4.3.30.0000.02015.57
4.3.20.0000.02015.57
4.3.10.0000.02315.57
4.3.00.0000.01715.57

preferences:
43.25 ms | 401 KiB | 5 Q