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.70.0090.00616.88
8.3.60.0090.00618.43
8.3.50.0110.00817.63
8.3.40.0090.00619.01
8.3.30.0040.01118.92
8.3.20.0070.01319.08
8.3.10.0000.00920.75
8.3.00.0060.00317.75
8.2.180.0150.00616.63
8.2.170.0150.00022.96
8.2.160.0000.01519.04
8.2.150.0000.00924.18
8.2.140.0030.00624.66
8.2.130.0060.01326.16
8.2.120.0040.00420.14
8.2.110.0030.00620.92
8.2.100.0190.00317.92
8.2.90.0000.00819.17
8.2.80.0030.00517.97
8.2.70.0090.00017.63
8.2.60.0090.00017.91
8.2.50.0040.00419.60
8.2.40.0050.00318.03
8.2.30.0080.00018.02
8.2.20.0000.00817.94
8.2.10.0040.00418.02
8.2.00.0040.00417.97
8.1.280.0110.00425.92
8.1.270.0150.00423.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0140.00722.40
8.1.230.0070.00420.97
8.1.220.0030.00518.77
8.1.210.0030.00518.92
8.1.200.0030.00917.60
8.1.190.0040.00417.66
8.1.180.0060.00318.10
8.1.170.0030.00518.73
8.1.160.0060.00318.92
8.1.150.0030.00618.86
8.1.140.0000.00817.52
8.1.130.0050.00217.86
8.1.120.0040.00417.51
8.1.110.0000.00817.63
8.1.100.0000.00817.52
8.1.90.0030.00517.65
8.1.80.0000.00717.52
8.1.70.0000.00817.61
8.1.60.0000.00817.64
8.1.50.0000.00817.62
8.1.40.0050.00317.62
8.1.30.0040.00417.77
8.1.20.0000.00817.82
8.1.10.0040.00417.63
8.1.00.0000.00817.53
8.0.300.0030.00619.85
8.0.290.0090.00016.63
8.0.280.0000.00718.35
8.0.270.0070.00017.28
8.0.260.0000.00718.67
8.0.250.0030.00517.20
8.0.240.0030.00617.23
8.0.230.0000.00717.19
8.0.220.0000.00717.18
8.0.210.0000.00717.10
8.0.200.0070.00017.08
8.0.190.0000.00717.19
8.0.180.0050.00217.04
8.0.170.0040.00417.02
8.0.160.0020.00517.07
8.0.150.0090.00016.94
8.0.140.0050.00516.93
8.0.130.0000.00613.53
8.0.120.0040.00417.05
8.0.110.0000.00716.98
8.0.100.0040.00417.11
8.0.90.0040.00417.22
8.0.80.0040.01217.07
8.0.70.0040.00417.13
8.0.60.0040.00416.93
8.0.50.0040.00417.15
8.0.30.0130.00717.35
8.0.20.0130.00817.30
8.0.10.0070.00017.04
8.0.00.0130.00716.94
7.4.330.0050.00015.00
7.4.320.0030.00316.70
7.4.300.0030.00316.77
7.4.290.0040.00416.64
7.4.280.0060.00316.75
7.4.270.0030.00516.63
7.4.260.0050.00013.47
7.4.250.0000.01016.85
7.4.240.0000.00716.80
7.4.230.0000.00716.70
7.4.220.0120.01616.77
7.4.210.0100.00616.79
7.4.200.0000.00716.92
7.4.190.0000.00816.99
7.4.160.0100.00716.81
7.4.150.0170.00017.07
7.4.140.0130.00717.22
7.4.130.0090.00816.87
7.4.120.0130.00616.75
7.4.110.0070.01116.65
7.4.100.0090.00916.70
7.4.90.0140.00416.68
7.4.80.0160.00018.80
7.4.70.0040.01416.61
7.4.60.0160.00016.72
7.4.50.0040.00416.57
7.4.40.0060.00322.27
7.4.30.0090.00916.76
7.4.10.0120.00315.41
7.4.00.0080.00815.39
7.3.330.0070.00013.66
7.3.320.0050.00013.40
7.3.310.0040.00416.50
7.3.300.0030.00316.59
7.3.290.0130.00316.61
7.3.280.0090.00916.61
7.3.270.0110.00717.07
7.3.260.0050.01218.24
7.3.250.0130.00616.62
7.3.240.0090.00916.86
7.3.230.0190.00016.78
7.3.210.0030.01816.80
7.3.200.0000.02019.39
7.3.190.0080.01416.75
7.3.180.0100.00616.77
7.3.170.0120.00816.91
7.3.160.0080.01316.60
7.3.130.0070.01115.03
7.3.120.0060.01215.25
7.3.110.0060.01014.94
7.3.100.0040.01215.27
7.3.90.0070.01315.30
7.3.80.0030.01215.16
7.3.70.0030.00915.05
7.3.60.0100.00715.07
7.3.50.0070.01015.21
7.3.40.0100.00314.83
7.3.30.0060.00615.14
7.3.20.0070.00716.88
7.3.10.0070.01116.86
7.3.00.0070.00716.57
7.2.330.0080.00816.89
7.2.320.0090.01216.89
7.2.310.0160.00616.80
7.2.300.0110.01416.88
7.2.290.0070.01116.82
7.2.260.0070.01015.38
7.2.250.0110.00714.97
7.2.240.0070.01015.25
7.2.230.0040.00715.25
7.2.220.0000.01514.95
7.2.210.0110.00315.22
7.2.200.0070.00715.41
7.2.190.0030.01415.14
7.2.180.0130.00015.25
7.2.170.0070.00715.24
7.2.160.0040.01215.26
7.2.150.0110.00717.06
7.2.140.0090.00917.26
7.2.130.0060.00917.10
7.2.120.0080.00717.15
7.2.110.0070.00917.20
7.2.100.0100.00717.09
7.2.90.0130.00317.15
7.2.80.0130.00217.13
7.2.70.0040.00617.21
7.2.60.0050.00817.08
7.2.50.0030.01017.07
7.2.40.0060.00917.16
7.2.30.0060.01017.14
7.2.20.0050.00816.84
7.2.10.0050.00816.98
7.2.00.0090.00717.90
7.1.330.0000.01315.94
7.1.320.0100.00615.99
7.1.310.0060.00615.98
7.1.300.0060.00616.06
7.1.290.0000.01216.05
7.1.280.0130.00316.16
7.1.270.0030.01215.96
7.1.260.0030.00615.96
7.1.250.0030.01015.85
7.1.240.0040.00816.03
7.1.230.0060.00916.03
7.1.220.0020.01116.05
7.1.210.0070.00815.89
7.1.200.0010.00915.90
7.1.190.0060.01016.00
7.1.180.0040.00616.01
7.1.170.0050.00615.75
7.1.160.0050.01115.89
7.1.150.0030.01016.03
7.1.140.0050.00415.95
7.1.130.0020.01115.96
7.1.120.0060.00816.09
7.1.110.0040.00715.99
7.1.100.0060.00516.68
7.1.90.0030.01016.08
7.1.80.0090.00516.05
7.1.70.0050.00816.50
7.1.60.0070.00816.95
7.1.50.0050.01016.49
7.1.40.0030.01015.82
7.1.30.0070.00815.91
7.1.20.0060.00516.00
7.1.10.0030.01015.99
7.1.00.0050.03118.03
7.0.330.0070.00315.68
7.0.320.0060.00915.70
7.0.310.0070.00515.35
7.0.300.0060.00515.56
7.0.290.0050.01115.73
7.0.280.0050.00715.66
7.0.270.0070.00815.58
7.0.260.0060.00715.48
7.0.250.0070.00515.52
7.0.240.0070.00715.69
7.0.230.0050.00615.66
7.0.220.0050.00715.59
7.0.210.0080.00515.81
7.0.200.0040.00615.99
7.0.190.0090.00615.74
7.0.180.0060.00715.49
7.0.170.0060.00615.74
7.0.160.0050.00815.66
7.0.150.0040.00915.61
7.0.140.0060.02617.64
7.0.130.0040.00615.50
7.0.120.0090.00115.55
7.0.110.0100.00515.48
7.0.100.0030.01215.45
7.0.90.0050.00715.69
7.0.80.0000.01215.78
7.0.70.0050.00715.62
7.0.60.0050.02517.64
7.0.50.0060.02216.41
7.0.40.0040.02215.79
7.0.30.0100.02015.91
7.0.20.0180.03015.88
7.0.10.0120.02815.81
7.0.00.0040.03415.86
5.6.400.0060.00614.71
5.6.390.0100.00314.99
5.6.380.0080.00714.26
5.6.370.0060.00514.71
5.6.360.0040.00614.74
5.6.350.0050.00714.38
5.6.340.0110.00314.62
5.6.330.0090.00514.69
5.6.320.0100.00414.81
5.6.310.0030.00714.57
5.6.300.0100.00514.59
5.6.290.0020.00914.63
5.6.280.0060.02716.54
5.6.270.0050.00814.37
5.6.260.0070.00514.64
5.6.250.0010.01014.49
5.6.240.0060.00314.62
5.6.230.0040.00614.44
5.6.220.0060.00814.62
5.6.210.0020.02116.58
5.6.200.0100.03015.84
5.6.190.0040.03616.45
5.6.180.0160.01816.48
5.6.170.0140.01616.52
5.6.160.0080.02816.42
5.6.150.0080.01915.61
5.6.140.0090.02615.76
5.6.130.0060.02815.70
5.6.120.0090.03216.58
5.6.110.0070.02316.59
5.6.100.0060.02716.57
5.6.90.0060.03316.67
5.6.80.0040.02016.31
5.6.70.0050.00814.28
5.6.60.0030.00714.33
5.6.50.0030.00614.40
5.6.40.0050.01114.30
5.6.30.0080.00514.46
5.6.20.0050.00714.41
5.6.10.0070.00914.56
5.6.00.0100.00314.36
5.5.380.0050.00512.81
5.5.370.0040.00612.89
5.5.360.0030.00612.97
5.5.350.0760.01715.28
5.5.340.0090.02914.61
5.5.330.0090.02915.29
5.5.320.0110.01715.25
5.5.310.0140.02515.33
5.5.300.0050.01714.55
5.5.290.0040.03314.53
5.5.280.0070.02415.61
5.5.270.0030.01915.45
5.5.260.0050.01715.52
5.5.250.0080.02115.30
5.5.240.0040.03215.27
5.5.230.0070.00512.87
5.5.220.0050.00712.73
5.5.210.0030.00512.76
5.5.200.0070.00412.75
5.5.190.0000.01412.78
5.5.180.0030.00912.83
5.5.170.0050.00712.98
5.5.160.0030.00712.61
5.5.150.0060.00812.84
5.5.140.0020.01012.85
5.5.130.0040.00612.94
5.5.120.0050.00712.65
5.5.110.0070.00512.67
5.5.100.0070.00712.84
5.5.90.0060.00512.64
5.5.80.0060.00712.75
5.5.70.0070.00612.98
5.5.60.0040.00512.86
5.5.50.0030.00812.65
5.5.40.0030.00612.74
5.5.30.0050.00712.82
5.5.20.0070.00512.79
5.5.10.0040.00712.86
5.5.00.0050.00612.63
5.4.450.1340.01713.99
5.4.440.1290.02014.09
5.4.430.1410.01714.02
5.4.420.1240.01514.03
5.4.410.1320.01813.91
5.4.400.1320.01013.75
5.4.390.1310.01813.72
5.4.380.1360.01713.80
5.4.370.1300.01613.78
5.4.360.1330.01713.85
5.4.350.1390.01813.81
5.4.340.1220.01713.93
5.4.330.0050.00511.03
5.4.320.1210.01813.79
5.4.310.1530.01213.81
5.4.300.1010.01813.86
5.4.290.1130.01813.81
5.4.280.1290.01913.85
5.4.270.1340.01813.91
5.4.260.1500.01713.78
5.4.250.1450.01613.95
5.4.240.1340.01813.81
5.4.230.1370.01713.92
5.4.220.1310.01613.69
5.4.210.1310.01613.75
5.4.200.1300.01513.88
5.4.190.1240.01613.92
5.4.180.1230.01713.78
5.4.170.1430.01813.99
5.4.160.1430.01513.84
5.4.150.1620.01913.81
5.4.140.1300.01612.95
5.4.130.1320.01612.85
5.4.120.1270.01712.99
5.4.110.1310.01613.08
5.4.100.1470.01712.97
5.4.90.1500.01412.95
5.4.80.1320.01613.05
5.4.70.1300.01212.99
5.4.60.1330.01513.06
5.4.50.1220.01712.98
5.4.40.1220.01612.90
5.4.30.1290.01912.90
5.4.20.1290.01612.95
5.4.10.0040.01912.93
5.4.00.0040.02812.81
5.3.290.1250.01612.22
5.3.280.1410.01312.16
5.3.270.1520.01312.09
5.3.260.1540.01712.23
5.3.250.1310.01612.19
5.3.240.1170.02012.03
5.3.230.1230.01412.12
5.3.220.1320.01612.04
5.3.210.1250.01612.16
5.3.200.1420.01412.12
5.3.190.1220.01812.10
5.3.180.1460.01412.11
5.3.170.1260.01712.24
5.3.160.1280.01512.17
5.3.150.1300.01412.18
5.3.140.1220.01712.18
5.3.130.1220.01712.13
5.3.120.1400.01712.16
5.3.110.0060.01812.08
5.3.100.0690.01911.95
5.3.90.1310.01611.98
5.3.80.1260.01011.93
5.3.70.1230.01611.95
5.3.60.1320.01511.91
5.3.50.1190.01612.01
5.3.40.1300.01911.97
5.3.30.1320.01911.81
5.3.20.1330.01311.77
5.3.10.1290.01911.76
5.3.00.1480.01511.78
5.2.170.2050.01911.14
5.2.160.2020.01811.17
5.2.150.1650.01911.18
5.2.140.1700.01311.14
5.2.130.1570.01511.17
5.2.120.1580.01711.21
5.2.110.1650.01811.14
5.2.100.1750.01811.22
5.2.90.1660.01111.17
5.2.80.1700.01811.22
5.2.70.0370.02111.15
5.2.60.0090.02311.14
5.2.50.0030.03111.04
5.2.40.0280.02711.06
5.2.30.1300.01811.10
5.2.20.1370.01811.07
5.2.10.1370.02111.02
5.2.00.1400.02010.94
5.1.60.1400.01610.61
5.1.50.1580.01510.56
5.1.40.1450.01310.61
5.1.30.1600.01710.76
5.1.20.1460.01310.77
5.1.10.1320.01710.66
5.1.00.1360.01210.66
5.0.50.0750.0169.82
5.0.40.0750.0139.78
5.0.30.0900.0199.66
5.0.20.0760.0109.67
5.0.10.0940.0109.69
5.0.00.0780.0209.68
4.4.90.0020.0188.59
4.4.80.0000.0188.59
4.4.70.0600.0108.59
4.4.60.0700.0108.59
4.4.50.0800.0088.59
4.4.40.0900.0158.59
4.4.30.0830.0088.59
4.4.20.0810.0108.59
4.4.10.0770.0108.59
4.4.00.0820.0138.59
4.3.110.0820.0138.59
4.3.100.0970.0108.59
4.3.90.0940.0088.59
4.3.80.0730.0138.59
4.3.70.0750.0128.59
4.3.60.0850.0108.59
4.3.50.0780.0108.59
4.3.40.0830.0158.59
4.3.30.0380.0128.59
4.3.20.0470.0138.59
4.3.10.0470.0148.59
4.3.00.0420.0128.59

preferences:
60.42 ms | 401 KiB | 5 Q