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(',', $string, 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.0150.00418.30
8.3.50.0110.01118.17
8.3.40.0110.00418.70
8.3.30.0150.00618.51
8.3.20.0070.00020.14
8.3.10.0110.00721.79
8.3.00.0110.00719.25
8.2.180.0140.00016.50
8.2.170.0060.00922.96
8.2.160.0060.00920.29
8.2.150.0110.00724.18
8.2.140.0000.00824.66
8.2.130.0140.00322.01
8.2.120.0080.00626.35
8.2.110.0100.00022.29
8.2.100.0090.00417.72
8.2.90.0080.00019.15
8.2.80.0080.00017.97
8.2.70.0030.00617.38
8.2.60.0000.00817.93
8.2.50.0000.00918.22
8.2.40.0030.00720.55
8.2.30.0040.00419.36
8.2.20.0040.00418.12
8.2.10.0000.00818.10
8.2.00.0000.00818.23
8.1.280.0170.01025.92
8.1.270.0040.01123.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.88
8.1.230.0040.00817.60
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0030.00617.13
8.1.180.0040.00418.10
8.1.170.0040.00418.71
8.1.160.0040.00418.88
8.1.150.0040.00418.93
8.1.140.0000.00717.71
8.1.130.0050.00218.89
8.1.120.0050.00317.52
8.1.110.0030.00617.46
8.1.100.0000.00717.45
8.1.90.0040.00417.51
8.1.80.0030.00817.36
8.1.70.0020.00517.48
8.1.60.0050.00317.47
8.1.50.0000.00817.42
8.1.40.0080.00317.44
8.1.30.0040.00417.58
8.1.20.0000.00817.58
8.1.10.0000.00817.50
8.1.00.0040.00417.34
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0030.00318.39
8.0.270.0100.00017.23
8.0.260.0000.00718.95
8.0.250.0070.00016.84
8.0.240.0040.00416.93
8.0.230.0000.00716.95
8.0.220.0000.00716.92
8.0.210.0000.00716.91
8.0.200.0030.00316.94
8.0.190.0040.00416.93
8.0.180.0040.00416.96
8.0.170.0080.00016.78
8.0.160.0040.00416.89
8.0.150.0040.00416.83
8.0.140.0070.00016.74
8.0.130.0050.00013.26
8.0.120.0040.00416.77
8.0.110.0000.00816.80
8.0.100.0000.00716.91
8.0.90.0040.00416.93
8.0.80.0070.01116.90
8.0.70.0000.00716.96
8.0.60.0040.00416.87
8.0.50.0000.00816.89
8.0.30.0100.01017.11
8.0.20.0100.01017.40
8.0.10.0000.00717.01
8.0.00.0070.01116.86
7.4.330.0050.00016.83
7.4.320.0030.00316.53
7.4.300.0000.00616.51
7.4.290.0030.00316.55
7.4.280.0030.00616.40
7.4.270.0030.00316.61
7.4.260.0030.00316.47
7.4.250.0050.00216.43
7.4.240.0030.00316.41
7.4.230.0030.00316.50
7.4.220.0040.00416.55
7.4.210.0030.01316.57
7.4.200.0000.00716.67
7.4.160.0090.01016.54
7.4.150.0090.01017.40
7.4.140.0080.01217.86
7.4.130.0160.00716.52
7.4.120.0130.00916.50
7.4.110.0070.01016.51
7.4.100.0040.01216.30
7.4.90.0060.01216.39
7.4.80.0070.01119.39
7.4.70.0090.00916.53
7.4.60.0060.00916.34
7.4.50.0070.00716.42
7.4.40.0060.01216.64
7.4.00.0100.00814.85
7.3.330.0080.00013.23
7.3.320.0000.00713.29
7.3.310.0040.00416.11
7.3.300.0030.00316.15
7.3.290.0060.01116.28
7.3.280.0080.01016.28
7.3.270.0090.01517.40
7.3.260.0140.00716.48
7.3.250.0090.00816.41
7.3.240.0100.01116.42
7.3.230.0030.01516.50
7.3.210.0060.01016.38
7.3.200.0130.00416.24
7.3.190.0090.00616.56
7.3.180.0160.00016.32
7.3.170.0060.01216.53
7.3.160.0080.01116.38
7.3.120.0070.01314.89
7.3.110.0130.00614.77
7.3.100.0030.01315.07
7.3.90.0070.00714.93
7.3.80.0090.00314.75
7.3.70.0030.00914.78
7.3.60.0070.00714.81
7.3.50.0070.00714.58
7.3.40.0070.00314.93
7.3.30.0060.00914.91
7.3.20.0070.00716.67
7.3.10.0030.01216.54
7.3.00.0000.01116.56
7.2.330.0060.01216.52
7.2.320.0000.01816.51
7.2.310.0170.00016.47
7.2.300.0090.00916.32
7.2.290.0090.00816.36
7.2.250.0040.01514.84
7.2.240.0070.01414.90
7.2.230.0070.00314.82
7.2.220.0070.00715.19
7.2.210.0080.01215.01
7.2.200.0090.00315.17
7.2.190.0030.01014.79
7.2.180.0030.01015.13
7.2.170.0060.00915.09
7.2.60.0060.00916.99
7.2.10.0520.01917.65
7.2.00.0410.01317.92
7.1.330.0030.01015.77
7.1.320.0030.01015.57
7.1.310.0060.01015.77
7.1.300.0060.00915.82
7.1.290.0090.00316.00
7.1.280.0070.00715.52
7.1.270.0000.01315.90
7.1.260.0000.00915.66
7.1.200.0100.00315.93
7.1.130.0440.01316.90
7.1.120.0440.01017.00
7.1.110.0610.00316.17
7.1.100.0560.00416.40
7.1.90.0300.00715.58
7.1.80.0450.01216.13
7.1.70.0160.00615.27
7.1.60.0580.00633.20
7.1.50.0470.01632.97
7.1.40.0480.01132.48
7.1.30.0570.02932.74
7.1.20.0560.01032.57
7.1.10.0460.00414.91
7.1.00.0450.01014.79

preferences:
57.28 ms | 401 KiB | 5 Q