3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $output = array_slice(array_merge(explode(' | ', $input), array(null)), 0, 2); $input = 'one'; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output); $input = 'one | two'; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output); $input = 'one | two | three'; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output); $input = 'one | two | three | '; $output = explode(" | ", "$input | ")[0][1]; print_r($output);

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.0120.00916.38
8.3.50.0120.00721.91
8.3.40.0040.01118.75
8.3.30.0100.00318.91
8.3.20.0070.00020.07
8.3.10.0080.00023.53
8.3.00.0080.00022.30
8.2.180.0100.00716.38
8.2.170.0110.00422.96
8.2.160.0100.00322.12
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00422.22
8.2.110.0000.00919.14
8.2.100.0040.00717.91
8.2.90.0000.00819.22
8.2.80.0030.00617.97
8.2.70.0090.00017.38
8.2.60.0060.00618.04
8.2.50.0080.00018.07
8.2.40.0040.00418.15
8.2.30.0040.00418.10
8.2.20.0050.00217.60
8.2.10.0080.00017.84
8.2.00.0040.00417.65
8.1.280.0070.01025.92
8.1.270.0090.00023.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00022.20
8.1.230.0090.00320.67
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0000.00817.23
8.1.190.0050.00317.39
8.1.180.0050.00318.10
8.1.170.0000.00818.67
8.1.160.0040.00421.94
8.1.150.0040.00418.43
8.1.140.0000.00817.33
8.1.130.0000.00717.88
8.1.120.0040.00417.38
8.1.110.0070.00017.39
8.1.100.0040.00417.27
8.1.90.0070.00417.39
8.1.80.0000.00817.38
8.1.70.0030.00317.27
8.1.60.0060.00317.53
8.1.50.0000.00817.35
8.1.40.0040.00417.33
8.1.30.0040.00417.57
8.1.20.0070.00017.57
8.1.10.0000.00717.54
8.1.00.0030.00617.51
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0030.00318.47
8.0.270.0080.00017.12
8.0.260.0030.00316.81
8.0.250.0060.00016.93
8.0.240.0070.00016.91
8.0.230.0000.00716.88
8.0.220.0070.00016.85
8.0.210.0060.00316.92
8.0.200.0030.00316.93
8.0.190.0000.00816.80
8.0.180.0030.00516.86
8.0.170.0000.00816.93
8.0.160.0030.00616.82
8.0.150.0000.00716.77
8.0.140.0000.00716.73
8.0.130.0060.00013.30
8.0.120.0000.00816.74
8.0.110.0000.00716.74
8.0.100.0000.00716.94
8.0.90.0050.00316.92
8.0.80.0100.01016.80
8.0.70.0040.00416.88
8.0.60.0040.00416.84
8.0.50.0020.00516.70
8.0.30.0090.01017.13
8.0.20.0130.00517.40
8.0.10.0050.00216.93
8.0.00.0100.00316.73
7.4.330.0020.00215.00
7.4.320.0030.00316.38
7.4.300.0000.00616.42
7.4.290.0000.00716.35
7.4.280.0000.00716.50
7.4.270.0040.00516.45
7.4.260.0050.00316.39
7.4.250.0030.00316.38
7.4.240.0020.00516.41
7.4.230.0000.00716.24
7.4.220.0060.00916.38
7.4.210.0070.00916.43
7.4.200.0000.00716.55
7.4.190.0000.00716.50
7.4.160.0090.00616.66
7.4.150.0120.00617.40
7.4.140.0030.01617.86
7.4.130.0060.01216.64
7.4.120.0000.01916.50
7.4.110.0130.00416.39
7.4.100.0140.00516.63
7.4.90.0090.00916.49
7.4.80.0070.01419.39
7.4.70.0000.01616.57
7.4.60.0150.00616.25
7.4.50.0070.00016.52
7.4.40.0060.00622.77
7.4.30.0050.01116.31
7.4.00.0100.00514.66
7.3.330.0020.00513.11
7.3.320.0050.00012.95
7.3.310.0030.00316.35
7.3.300.0000.00716.25
7.3.290.0080.00816.34
7.3.280.0050.01316.22
7.3.270.0090.00917.40
7.3.260.0130.00416.24
7.3.250.0080.01316.46
7.3.240.0160.00016.41
7.3.230.0080.00816.60
7.3.210.0090.00916.45
7.3.200.0070.01019.39
7.3.190.0090.00616.55
7.3.180.0080.00816.59
7.3.170.0060.01216.30
7.3.160.0000.01616.31
7.3.120.0030.01414.88
7.3.110.0090.00915.02
7.3.100.0030.00914.73
7.3.90.0040.01114.81
7.3.80.0000.01214.86
7.3.70.0030.01214.57
7.3.60.0090.00614.80
7.3.50.0070.01414.77
7.3.40.0080.00414.79
7.3.30.0000.01014.64
7.3.20.0040.01116.50
7.3.10.0060.00916.34
7.3.00.0040.00716.66
7.2.330.0050.01116.71
7.2.320.0100.01316.60
7.2.310.0130.00416.50
7.2.300.0030.01416.43
7.2.290.0070.01016.64
7.2.250.0040.01414.93
7.2.240.0070.01114.92
7.2.230.0000.01515.29
7.2.220.0070.00714.89
7.2.210.0100.00615.30
7.2.200.0060.01015.13
7.2.190.0030.00714.70
7.2.180.0070.01414.87
7.2.170.0030.00714.96
7.1.330.0060.00915.85
7.1.320.0060.00315.84
7.1.310.0040.01115.71
7.1.300.0030.01015.82
7.1.290.0070.00715.92
7.1.280.0080.00415.68
7.1.270.0040.01115.68
7.1.260.0000.01115.71
7.1.70.0040.00416.80
7.1.60.0140.01119.29
7.1.50.0090.01316.82
7.1.00.0070.07322.57
7.0.200.0030.00916.73
7.0.140.0130.06322.12
7.0.60.0130.08019.92
7.0.50.0070.03717.87
7.0.40.0000.09320.02
7.0.30.0300.06020.11
7.0.20.0230.06320.26
7.0.10.0330.07720.10
7.0.00.0070.05020.25
5.6.280.0070.06720.99
5.6.210.0030.04020.66
5.6.200.0100.03718.19
5.6.190.0070.08020.50
5.6.180.0070.07720.47
5.6.170.0300.07320.56
5.6.160.0170.08020.70
5.6.150.0130.05318.14
5.6.140.0030.04318.23
5.6.130.0070.06718.16
5.6.120.0130.08020.91
5.6.110.0170.07321.13
5.6.100.0100.03320.99
5.6.90.0130.07720.98
5.6.80.0100.08020.42
5.6.70.0400.06320.39
5.5.350.0030.03020.52
5.5.340.0200.07317.96
5.5.330.0130.08320.40
5.5.320.0030.04020.27
5.5.310.0170.05320.27
5.5.300.0030.05017.97
5.5.290.0130.04718.08
5.5.280.0130.07320.96
5.5.270.0100.08020.86
5.5.260.0070.08020.63
5.5.250.0070.03720.79
5.5.240.0130.06720.25
5.4.450.1130.04019.39
5.4.440.2270.04319.41
5.4.430.2770.03719.31
5.4.420.3130.04319.38
5.4.410.2730.03719.44
5.4.400.2970.03018.87
5.4.390.2830.03019.23
5.4.380.2570.03718.98
5.4.370.0030.03719.09
5.4.360.0030.03719.19
5.4.350.0930.03718.95
5.4.340.3270.04318.96
5.4.320.2530.04019.09
5.4.310.2230.05019.24
5.4.300.2330.04319.10
5.4.290.1700.03719.13
5.4.280.2400.03719.22
5.4.270.2830.04319.07
5.4.260.2870.03719.16
5.4.250.0170.03718.86
5.4.240.0170.03719.00
5.4.230.0200.03319.16
5.4.220.0200.03719.31
5.4.210.0230.03319.19
5.4.200.0100.04019.15
5.4.190.0200.03018.82
5.4.180.0170.03718.98
5.4.170.0130.04018.98
5.4.160.0130.03719.19
5.4.150.0170.03719.21
5.4.140.0100.04016.50
5.4.130.0230.06716.34
5.4.120.0270.06716.51
5.4.110.0130.03716.19
5.4.100.0200.04316.19
5.4.90.0230.03716.58
5.4.80.0100.04016.39
5.4.70.0230.04316.26
5.4.60.0130.06316.43
5.4.50.0230.02716.48
5.4.40.0170.04316.35
5.4.30.0130.03716.50
5.4.20.0130.06016.32
5.4.10.0100.04016.37
5.4.00.0200.03015.84
5.3.290.0230.04314.76
5.3.280.0170.04714.70
5.3.270.0230.06314.55
5.3.260.0070.06014.55
5.3.250.0130.04014.65
5.3.240.0230.03014.56
5.3.230.0200.03314.55
5.3.220.0170.04314.42
5.3.210.0100.04314.43
5.3.200.0170.03714.42
5.3.190.0130.04314.62
5.3.180.0170.03714.50
5.3.170.0130.03714.52
5.3.160.0170.05314.40
5.3.150.0200.04314.44
5.3.140.0130.04014.65
5.3.130.0130.07314.40
5.3.120.0200.03314.49
5.3.110.0200.05314.46
5.3.100.0230.05313.89
5.3.90.0170.03314.01
5.3.80.0330.06013.96
5.3.70.0100.05013.96
5.3.60.0130.05013.99
5.3.50.0200.04313.85
5.3.40.0230.05713.89
5.3.30.0230.03713.71
5.3.20.0230.06713.52
5.3.10.0200.04313.44
5.3.00.0130.08313.46
5.2.170.0100.03010.99
5.2.160.0100.03011.30
5.2.150.0100.03010.99
5.2.140.0130.06310.98
5.2.130.0070.06310.98
5.2.120.0070.04711.04
5.2.110.0130.06711.11
5.2.100.0130.05311.04
5.2.90.0130.06011.27
5.2.80.0130.04010.94
5.2.70.0200.03711.18
5.2.60.0170.05311.13
5.2.50.0130.05010.91
5.2.40.0100.05710.86
5.2.30.0070.04010.82
5.2.20.0170.03010.80
5.2.10.0130.02310.93
5.2.00.0130.05710.84
5.1.60.0130.0279.88
5.1.50.0130.0209.89
5.1.40.0100.02710.10
5.1.30.0170.04310.21
5.1.20.0170.03310.53
5.1.10.0130.05310.20
5.1.00.0130.02010.00
5.0.50.0130.0408.66
5.0.40.0130.0138.54
5.0.30.0030.0578.12
5.0.20.0100.0438.35
5.0.10.0030.0208.33
5.0.00.0100.0238.24
4.4.90.0100.0276.04
4.4.80.0100.0206.04
4.4.70.0070.0206.04
4.4.60.0030.0176.04
4.4.50.0100.0336.04
4.4.40.0030.0276.04
4.4.30.0000.0406.04
4.4.20.0030.0306.04
4.4.10.0070.0236.04
4.4.00.0000.0376.04
4.3.110.0000.0336.04
4.3.100.0000.0336.04
4.3.90.0030.0276.04
4.3.80.0000.0236.04
4.3.70.0030.0136.04
4.3.60.0530.0176.04
4.3.50.1070.0136.04
4.3.40.0870.0276.04
4.3.30.0600.0276.04
4.3.20.0500.0206.04
4.3.10.0630.0206.04
4.3.00.0430.0176.04

preferences:
38.74 ms | 401 KiB | 5 Q