3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "ABCDE3883475"; $numbers = ""; $alphabets = ""; $strlen = strlen($string); for($i = 0; $i <= $strlen; $i++) { $char = substr($string, $i, 1); if(is_numeric($char)) { $numbers .= $char; } else { $alphabets .= $char; } } echo $numbers; echo PHP_EOL; echo $alphabets;

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.0070.01416.50
8.3.50.0090.00921.97
8.3.40.0110.00418.69
8.3.30.0060.01218.71
8.3.20.0040.00419.96
8.3.10.0000.00823.48
8.3.00.0080.00019.91
8.2.180.0070.00716.50
8.2.170.0040.01122.96
8.2.160.0140.00020.49
8.2.150.0040.00424.18
8.2.140.0110.00324.66
8.2.130.0070.00419.36
8.2.120.0140.00426.35
8.2.110.0030.00620.52
8.2.100.0080.00419.54
8.2.90.0000.00819.14
8.2.80.0040.00417.97
8.2.70.0080.00017.50
8.2.60.0030.00517.93
8.2.50.0040.00418.10
8.2.40.0090.00020.60
8.2.30.0040.00420.63
8.2.20.0030.00517.64
8.2.10.0040.00418.14
8.2.00.0040.00418.20
8.1.280.0000.01425.92
8.1.270.0080.00023.99
8.1.260.0120.00626.35
8.1.250.0050.00328.09
8.1.240.0040.00422.14
8.1.230.0040.00817.42
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0040.00417.10
8.1.180.0000.00918.10
8.1.170.0030.00518.59
8.1.160.0000.00722.21
8.1.150.0050.00218.77
8.1.140.0030.00519.52
8.1.130.0000.00717.58
8.1.120.0090.00017.37
8.1.110.0040.00417.43
8.1.100.0070.00017.41
8.1.90.0040.00417.38
8.1.80.0030.00617.46
8.1.70.0030.00317.37
8.1.60.0000.00717.52
8.1.50.0030.00617.35
8.1.40.0040.00417.43
8.1.30.0060.00317.54
8.1.20.0080.00017.46
8.1.10.0040.00417.37
8.1.00.0000.00717.44
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0040.00418.39
8.0.270.0030.00317.31
8.0.260.0030.00317.14
8.0.250.0040.00416.98
8.0.240.0070.00016.88
8.0.230.0000.00716.91
8.0.220.0030.00316.81
8.0.210.0040.00416.71
8.0.200.0000.00716.96
8.0.190.0040.00416.89
8.0.180.0040.00416.84
8.0.170.0000.00816.91
8.0.160.0000.00716.83
8.0.150.0040.00416.77
8.0.140.0000.00716.71
8.0.130.0000.00613.24
8.0.120.0040.00416.83
8.0.110.0000.00816.88
8.0.100.0040.00416.83
8.0.90.0070.00016.72
8.0.80.0040.01116.77
8.0.70.0040.00416.67
8.0.60.0030.00516.63
8.0.50.0040.00316.92
8.0.30.0140.00716.95
8.0.20.0090.01217.40
8.0.10.0000.00716.81
8.0.00.0080.00916.62
7.4.330.0000.00516.78
7.4.320.0000.00716.46
7.4.300.0000.00616.34
7.4.290.0070.00016.41
7.4.280.0000.00816.52
7.4.270.0030.00316.46
7.4.260.0000.00716.49
7.4.250.0030.00516.39
7.4.240.0020.00516.51
7.4.230.0050.00216.37
7.4.220.0090.00916.54
7.4.210.0040.01116.63
7.4.200.0040.00416.53
7.4.160.0080.00816.50
7.4.150.0130.00717.40
7.4.140.0100.01217.86
7.4.130.0080.00816.49
7.4.120.0070.01016.60
7.4.110.0060.01316.45
7.4.100.0070.01016.63
7.4.90.0130.00616.40
7.4.80.0110.00619.39
7.4.70.0110.01116.37
7.4.60.0130.00316.40
7.4.50.0080.00816.55
7.4.40.0090.00916.54
7.4.30.0100.01316.54
7.4.00.0030.01014.66
7.3.330.0000.00613.15
7.3.320.0000.00513.16
7.3.310.0000.00716.38
7.3.300.0030.00316.29
7.3.290.0080.00816.30
7.3.280.0090.00916.30
7.3.270.0070.01017.40
7.3.260.0030.01416.55
7.3.250.0100.00716.41
7.3.240.0090.00916.44
7.3.230.0110.00716.39
7.3.210.0130.00316.45
7.3.200.0060.01116.36
7.3.190.0060.00916.31
7.3.180.0100.00616.40
7.3.170.0030.01316.29
7.3.160.0060.01016.60
7.2.330.0070.01016.73
7.2.320.0120.00816.79
7.2.310.0100.00716.67
7.2.300.0030.01316.75
7.2.290.0070.01116.54
7.2.60.0060.00316.58
7.2.50.0130.00316.63
7.1.200.0030.01015.59
7.1.70.0060.00616.93
7.1.60.0130.01319.50
7.1.50.0100.01417.04
7.1.00.0070.07322.48
7.0.200.0030.00716.51
7.0.60.0070.08020.03
7.0.50.0070.05017.66
7.0.40.0170.05020.09
7.0.30.0200.05020.18
7.0.20.0400.07320.33
7.0.10.0000.04720.30
7.0.00.0100.08020.00
5.6.280.0130.03720.82
5.6.210.0030.08720.48
5.6.200.0030.04018.11
5.6.190.0030.09020.67
5.6.180.0270.04720.40
5.6.170.0130.06320.38
5.6.160.0070.08320.41
5.6.150.0100.03718.21
5.6.140.0030.06318.21
5.6.130.0070.07318.18
5.6.120.0070.05020.98
5.6.110.0070.06321.14
5.6.100.0070.07720.99
5.6.90.0070.08721.10
5.6.80.0170.08020.52
5.5.350.0270.05720.40
5.5.340.0130.07317.89
5.5.330.0030.05720.37
5.5.320.0100.08020.30
5.5.310.0270.08020.32
5.5.300.0070.08017.98
5.5.290.0030.08317.91
5.5.280.0070.08720.77
5.5.270.0000.07320.80
5.5.260.0000.08720.88
5.5.250.0170.06720.57
5.5.240.0100.03320.03

preferences:
58.67 ms | 401 KiB | 5 Q