3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $str = "A, B, C, D, E"; $components = explode(", ", $str); if (count($components) <= 1) { //If there's only one word, and no commas or whatever. echo $str; die(); //You don't have to *die* here, just stop the rest of the following from executing. } $last = array_pop($components); //This will remove the last element from the array, then put it in the $last variable. echo implode(", ", $components) . " &amp; " . $last;

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.00716.25
8.3.50.0150.00316.34
8.3.40.0110.00418.80
8.3.30.0080.00818.53
8.3.20.0040.00418.60
8.3.10.0030.00620.53
8.3.00.0030.00517.50
8.2.180.0090.00916.50
8.2.170.0140.00322.96
8.2.160.0070.00719.32
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00019.77
8.2.110.0060.00321.14
8.2.100.0030.00917.72
8.2.90.0000.00819.27
8.2.80.0040.00418.03
8.2.70.0030.00517.38
8.2.60.0000.00818.04
8.2.50.0080.00018.07
8.2.40.0040.00418.34
8.2.30.0040.00417.97
8.2.20.0070.00017.76
8.2.10.0080.00017.77
8.2.00.0000.00717.79
8.1.280.0040.01125.92
8.1.270.0080.00024.66
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0040.00420.82
8.1.230.0030.00721.04
8.1.220.0080.00017.89
8.1.210.0040.00419.04
8.1.200.0000.00817.35
8.1.190.0050.00317.53
8.1.180.0000.00818.10
8.1.170.0000.00818.82
8.1.160.0040.00418.76
8.1.150.0040.00418.59
8.1.140.0080.00017.44
8.1.130.0030.00317.89
8.1.120.0030.00417.36
8.1.110.0030.00517.37
8.1.100.0080.00017.34
8.1.90.0000.00717.44
8.1.80.0040.00417.46
8.1.70.0030.00317.40
8.1.60.0050.00217.65
8.1.50.0000.00717.50
8.1.40.0040.00417.57
8.1.30.0040.00417.53
8.1.20.0060.00317.61
8.1.10.0040.00417.48
8.1.00.0050.00317.30
8.0.300.0060.00619.91
8.0.290.0000.00816.63
8.0.280.0000.00718.45
8.0.270.0040.00417.25
8.0.260.0030.00316.75
8.0.250.0040.00416.96
8.0.240.0030.00516.92
8.0.230.0080.00016.92
8.0.220.0030.00316.92
8.0.210.0030.00416.93
8.0.200.0000.00916.95
8.0.190.0000.00716.99
8.0.180.0000.00716.87
8.0.170.0030.00616.93
8.0.160.0000.00816.94
8.0.150.0040.00416.91
8.0.140.0030.00516.84
8.0.130.0030.00313.38
8.0.120.0000.00816.85
8.0.110.0060.00316.86
8.0.100.0050.00316.69
8.0.90.0030.00616.93
8.0.80.0110.00416.88
8.0.70.0050.00216.68
8.0.60.0040.00416.92
8.0.50.0070.00016.77
8.0.30.0130.00916.79
8.0.20.0080.01017.07
8.0.10.0000.00716.97
8.0.00.0120.00616.85
7.4.330.0050.00013.00
7.4.320.0000.00716.60
7.4.300.0030.00316.42
7.4.290.0000.00716.40
7.4.280.0030.00616.48
7.4.270.0080.00016.39
7.4.260.0000.00513.29
7.4.250.0040.00416.59
7.4.240.0070.00016.53
7.4.230.0000.00716.40
7.4.220.0060.01316.53
7.4.210.0070.00816.56
7.4.200.0070.00016.40
7.4.190.0050.00316.67
7.4.160.0120.00616.49
7.4.150.0160.00716.63
7.4.140.0110.00516.53
7.4.130.0060.01116.56
7.4.120.0090.01116.60
7.4.110.0090.00616.37
7.4.100.0130.00316.46
7.4.90.0070.01016.43
7.4.80.0100.01316.33
7.4.70.0140.00316.33
7.4.60.0060.00916.35
7.4.50.0000.00416.31
7.4.40.0070.00716.32
7.4.30.0100.00616.71
7.4.00.0100.00314.74
7.3.330.0000.00613.14
7.3.320.0000.00513.10
7.3.310.0000.00716.27
7.3.300.0030.00316.22
7.3.290.0040.01116.30
7.3.280.0080.00916.29
7.3.270.0090.00816.36
7.3.260.0080.00916.31
7.3.250.0120.00916.36
7.3.240.0090.00916.64
7.3.230.0070.01016.15
7.3.210.0100.00716.43
7.3.200.0120.00819.39
7.3.190.0060.01216.27
7.3.180.0060.01016.51
7.3.170.0100.00716.41
7.3.160.0100.00616.48
7.3.120.0120.00314.80
7.3.10.0080.00816.45
7.3.00.0100.00316.71
7.2.330.0030.01416.77
7.2.320.0070.01016.53
7.2.310.0100.01716.73
7.2.300.0090.00916.68
7.2.290.0090.00816.43
7.2.130.0030.01016.95
7.2.120.0090.00616.91
7.2.110.0070.00716.71
7.2.100.0070.00716.85
7.2.90.0000.01516.94
7.2.80.0060.00917.13
7.2.70.0030.01016.73
7.2.60.0020.01416.81
7.2.50.0090.00616.80
7.2.40.0090.00616.88
7.2.30.0000.01216.71
7.2.20.0030.01016.94
7.2.10.0000.01316.74
7.2.00.0060.00918.36
7.1.250.0030.01315.91
7.1.200.0160.00515.72
7.1.100.0000.01117.82
7.1.70.0040.00417.15
7.1.60.0040.01219.40
7.1.50.0030.01016.59
7.1.00.0070.08022.26
7.0.200.0030.00616.53
7.0.140.0070.07022.12
7.0.120.0070.05022.00
7.0.60.0030.06320.02
7.0.50.0030.04017.80
7.0.40.0070.04320.05
7.0.30.0230.07720.00
7.0.20.0130.05020.19
7.0.10.0070.05320.16
7.0.00.0030.05720.08
5.6.280.0170.06321.13
5.6.210.0170.07720.71
5.6.200.0030.05018.08
5.6.190.0070.08320.45
5.6.180.0230.06020.41
5.6.170.0230.08020.51
5.6.160.0100.07020.32
5.6.150.0070.08318.22
5.6.140.0070.06718.18
5.6.130.0100.07718.07
5.6.120.0100.08021.02
5.6.110.0030.07720.94
5.6.100.0070.08021.08
5.6.90.0200.07320.94
5.6.80.0100.07720.50
5.5.350.0230.03720.46
5.5.340.0100.05718.02
5.5.330.0070.08020.36
5.5.320.0270.04320.17
5.5.310.0330.03720.50
5.5.300.0000.04717.89
5.5.290.0100.03317.93
5.5.280.0130.07720.73
5.5.270.0200.08020.75
5.5.260.0100.08020.73
5.5.250.0030.08320.54
5.5.240.0000.03720.26
5.4.450.2000.05019.42
5.4.440.2100.04719.10
5.4.430.1830.03319.41
5.4.420.1800.03719.12
5.4.410.2100.04019.29
5.4.400.2100.04719.10
5.4.390.2030.04019.25
5.4.380.2200.04019.13
5.4.370.2130.04719.08
5.4.360.2170.05319.06
5.4.350.2170.04719.25
5.4.340.2200.04319.10
5.4.320.2100.05019.10
5.4.310.1870.05319.13
5.4.300.1970.04318.77
5.4.290.1930.03319.24
5.4.280.1900.03019.11
5.4.270.2070.03719.06
5.4.260.1930.04018.91
5.4.250.2030.04718.88
5.4.240.2070.04319.07
5.4.230.1870.04019.13
5.4.220.2270.04319.15
5.4.210.1830.04318.93
5.4.200.1800.03719.24
5.4.190.1970.04319.20
5.4.180.2230.04018.76
5.4.170.2030.03319.21
5.4.160.1930.05019.23
5.4.150.1830.03719.07
5.4.140.2130.04316.53
5.4.130.2100.04716.36
5.4.120.2030.03716.29
5.4.110.2130.04316.41
5.4.100.2100.04316.51
5.4.90.2170.04016.40
5.4.80.2070.03716.32
5.4.70.2270.04316.16
5.4.60.2100.04316.28
5.4.50.2130.03716.40
5.4.40.2030.04316.15
5.4.30.1930.03316.38
5.4.20.2000.03316.36
5.4.10.2300.04016.31
5.4.00.2130.04015.76
5.3.290.1830.04014.51
5.3.280.2130.04314.61
5.3.270.2330.04014.56
5.3.260.1970.02714.66
5.3.250.1670.03314.44
5.3.240.2270.04714.62
5.3.230.2070.03014.43
5.3.220.2200.04014.53
5.3.210.1970.03714.40
5.3.200.2430.04014.52
5.3.190.2170.03714.55
5.3.180.2330.04314.61
5.3.170.1970.03314.52
5.3.160.0770.04314.43
5.3.150.0070.07714.41
5.3.140.0030.04314.51
5.3.130.0230.03714.64
5.3.120.2370.04714.39
5.3.110.2370.05014.42
5.3.100.1930.04313.91
5.3.90.1900.04013.87
5.3.80.2070.04014.00
5.3.70.2030.04013.85
5.3.60.2000.04013.84
5.3.50.2230.03713.78
5.3.40.1900.04013.89
5.3.30.2030.03713.86
5.3.20.2000.03313.59
5.3.10.1830.03313.53
5.3.00.2170.03313.62
5.2.170.1770.02710.98
5.2.160.1700.02311.11
5.2.150.1700.03010.98
5.2.140.1900.03711.19
5.2.130.1900.03011.05
5.2.120.1900.02011.12
5.2.110.1800.04011.14
5.2.100.1700.03010.96
5.2.90.1730.03011.15
5.2.80.1570.03011.14
5.2.70.1730.04011.03
5.2.60.1900.03011.05
5.2.50.1800.03011.17
5.2.40.1230.03311.14
5.2.30.1230.03311.02
5.2.20.1470.03311.00
5.2.10.1600.03010.87
5.2.00.1270.03010.57
5.1.60.1300.0239.96
5.1.50.1330.02710.00
5.1.40.1500.02310.14
5.1.30.1530.03310.40
5.1.20.1600.02710.50
5.1.10.1530.0309.95
5.1.00.1500.02310.14
5.0.50.0600.0238.63
5.0.40.0600.0238.63
5.0.30.0800.0378.63
5.0.20.0030.0178.63
5.0.10.0030.0278.63
5.0.00.0000.0308.63
4.4.90.0030.0238.63
4.4.80.0000.0178.63
4.4.70.0030.0338.63
4.4.60.0030.0238.63
4.4.50.0000.0238.63
4.4.40.0030.0238.63
4.4.30.0000.0378.63
4.4.20.0330.0208.63
4.4.10.0830.0208.63
4.4.00.0800.0308.63
4.3.110.0830.0238.63
4.3.100.0800.0208.63
4.3.90.0700.0178.63
4.3.80.0870.0338.63
4.3.70.0770.0178.63
4.3.60.0830.0178.63
4.3.50.0730.0208.63
4.3.40.0900.0278.63
4.3.30.0370.0208.63
4.3.20.0470.0278.63
4.3.10.0330.0208.63
4.3.00.0300.0178.63

preferences:
46.29 ms | 401 KiB | 5 Q