3v4l.org

run code in 300+ PHP versions simultaneously
<?php function p_explode($del, $str, $cnt) { if (count(explode($del, $str) <= $cnt)) return [$str]; $tmp = explode($del, $str, $cnt); $last = array_pop($tmp); return array_merge($tmp, p_explode($del, $last, $cnt)); } $string ='1,2,3,4,5,6,7,8,9,10,11,12,13,14,15'; var_dump(p_explode(',', $str, 4));

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.01518.38
8.3.50.0090.00918.06
8.3.40.0070.00718.85
8.3.30.0060.00918.60
8.3.20.0060.00320.24
8.3.10.0110.00721.74
8.3.00.0060.00319.51
8.2.180.0080.00816.88
8.2.170.0070.01022.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0100.00724.66
8.2.130.0080.00022.29
8.2.120.0050.00226.35
8.2.110.0070.00322.11
8.2.100.0040.00717.91
8.2.90.0050.00319.08
8.2.80.0030.00517.97
8.2.70.0040.00417.63
8.2.60.0050.00317.93
8.2.50.0030.00518.22
8.2.40.0030.00720.63
8.2.30.0030.00519.23
8.2.20.0070.00018.12
8.2.10.0080.00018.20
8.2.00.0000.00718.22
8.1.280.0160.00325.92
8.1.270.0080.00020.00
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00423.88
8.1.230.0040.00717.70
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0080.00018.51
8.1.160.0050.00218.91
8.1.150.0000.00718.89
8.1.140.0040.00417.62
8.1.130.0000.00718.77
8.1.120.0000.00717.48
8.1.110.0070.00317.36
8.1.100.0000.00817.37
8.1.90.0030.00517.48
8.1.80.0000.01017.37
8.1.70.0030.00617.46
8.1.60.0040.00417.59
8.1.50.0050.00317.55
8.1.40.0030.00617.50
8.1.30.0060.00317.67
8.1.20.0080.00017.55
8.1.10.0050.00217.59
8.1.00.0100.00017.44
8.0.300.0080.00018.77
8.0.290.0070.00016.75
8.0.280.0000.00718.41
8.0.270.0040.00417.26
8.0.260.0000.00618.95
8.0.250.0000.00716.89
8.0.240.0030.00317.05
8.0.230.0040.00416.91
8.0.220.0030.00316.84
8.0.210.0030.00316.81
8.0.200.0000.00617.01
8.0.190.0050.00316.89
8.0.180.0030.00316.94
8.0.170.0000.00917.02
8.0.160.0030.00516.82
8.0.150.0030.00616.94
8.0.140.0030.00616.76
8.0.130.0000.00613.32
8.0.120.0040.00416.91
8.0.110.0070.00016.90
8.0.100.0000.00716.84
8.0.90.0040.00416.93
8.0.80.0100.01117.03
8.0.70.0040.00416.96
8.0.60.0040.00416.83
8.0.50.0000.00816.79
8.0.30.0090.00817.04
8.0.20.0110.00917.40
8.0.10.0000.00717.00
8.0.00.0060.01116.69
7.4.330.0000.00516.76
7.4.320.0000.00716.37
7.4.300.0030.00316.61
7.4.290.0000.00716.61
7.4.280.0040.00416.58
7.4.270.0070.00016.46
7.4.260.0000.00716.49
7.4.250.0030.00316.42
7.4.240.0030.00316.62
7.4.230.0030.00316.45
7.4.220.0020.00516.41
7.4.210.0030.01316.55
7.4.200.0000.00716.64
7.4.160.0100.00716.58
7.4.150.0090.00817.40
7.4.140.0110.01017.86
7.4.130.0180.00416.31
7.4.120.0110.00916.50
7.4.110.0130.00316.65
7.4.100.0120.00616.70
7.4.90.0070.01016.53
7.4.80.0100.01319.39
7.4.70.0070.01016.62
7.4.60.0110.00516.32
7.4.50.0040.01516.38
7.4.40.0070.01016.25
7.4.00.0110.00515.13
7.3.330.0030.00513.14
7.3.320.0000.00613.22
7.3.310.0040.00416.31
7.3.300.0000.00616.23
7.3.290.0090.00716.37
7.3.280.0050.01216.33
7.3.270.0110.00817.40
7.3.260.0110.00716.45
7.3.250.0090.01016.50
7.3.240.0070.01116.46
7.3.230.0080.00916.30
7.3.210.0120.00416.64
7.3.200.0120.02316.61
7.3.190.0090.00616.46
7.3.180.0060.00916.54
7.3.170.0110.00416.45
7.3.160.0090.01316.38
7.3.120.0070.01014.83
7.3.110.0030.01614.55
7.3.100.0060.00914.91
7.3.90.0040.00714.63
7.3.80.0160.00314.90
7.3.70.0080.00514.90
7.3.60.0050.00514.86
7.3.50.0100.00014.73
7.3.40.0140.00014.71
7.3.30.0060.01014.58
7.3.20.0000.00916.46
7.3.10.0040.00816.82
7.3.00.0000.01516.60
7.2.330.0130.00316.49
7.2.320.0120.00616.62
7.2.310.0090.00916.80
7.2.300.0100.00716.57
7.2.290.0080.01116.55
7.2.250.0130.00615.00
7.2.240.0030.01815.27
7.2.230.0000.01515.06
7.2.220.0030.01415.22
7.2.210.0040.01114.52
7.2.200.0070.01015.02
7.2.190.0040.01114.94
7.2.180.0070.00415.02
7.2.170.0000.01014.80
7.2.60.0070.01016.89
7.2.10.0330.01617.89
7.2.00.0440.01217.76
7.1.330.0100.00315.82
7.1.320.0060.00615.87
7.1.310.0130.00316.04
7.1.300.0080.00815.75
7.1.290.0090.00615.88
7.1.280.0060.00616.00
7.1.270.0000.00915.85
7.1.260.0090.00015.46
7.1.200.0150.00415.71
7.1.130.0360.01016.49
7.1.120.0450.00616.80
7.1.110.0530.00715.78
7.1.100.0360.00916.30
7.1.90.0120.00315.76
7.1.80.0510.01316.13
7.1.70.0390.01215.18
7.1.60.0500.01333.16
7.1.50.0540.00633.08
7.1.40.0550.01832.64
7.1.30.0220.01332.76
7.1.20.0590.00732.87
7.1.10.0060.00915.00
7.1.00.0100.01014.94

preferences:
61.7 ms | 401 KiB | 5 Q