3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_array = array('a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd', 'e' => 'e'); print_r(array_slice($input_array, 0, 2, true)); print_r(array_slice($input_array, 0, 2));

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.01016.63
8.3.50.0090.01017.40
8.3.40.0070.00718.58
8.3.30.0110.00418.73
8.3.20.0050.00318.66
8.3.10.0080.00020.54
8.3.00.0040.00419.13
8.2.180.0000.01516.38
8.2.170.0070.00722.96
8.2.160.0070.00720.88
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0100.00017.50
8.2.110.0070.00322.27
8.2.100.0070.00317.72
8.2.90.0000.00819.23
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0080.00017.93
8.2.50.0060.00318.10
8.2.40.0000.00818.09
8.2.30.0060.00318.00
8.2.20.0000.00817.52
8.2.10.0000.00717.61
8.2.00.0000.00717.55
8.1.280.0090.00625.92
8.1.270.0040.00424.66
8.1.260.0030.00626.35
8.1.250.0070.00028.09
8.1.240.0030.00722.04
8.1.230.0120.00017.83
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0070.00317.22
8.1.190.0040.00417.11
8.1.180.0050.00318.10
8.1.170.0040.00418.97
8.1.160.0060.00318.67
8.1.150.0050.00318.57
8.1.140.0000.00817.37
8.1.130.0040.00417.84
8.1.120.0000.00717.26
8.1.110.0070.00017.31
8.1.100.0050.00317.39
8.1.90.0110.00017.46
8.1.80.0040.00417.28
8.1.70.0000.00717.28
8.1.60.0060.00317.57
8.1.50.0050.00217.45
8.1.40.0000.00717.46
8.1.30.0000.00717.44
8.1.20.0080.00017.59
8.1.10.0000.00717.32
8.1.00.0000.00717.38
8.0.300.0000.00818.77
8.0.290.0080.00016.58
8.0.280.0030.00318.37
8.0.270.0030.00317.07
8.0.260.0030.00316.70
8.0.250.0040.00416.78
8.0.240.0030.00316.91
8.0.230.0000.00716.79
8.0.220.0000.00716.80
8.0.210.0000.00716.71
8.0.200.0030.00316.75
8.0.190.0000.00716.83
8.0.180.0000.00716.78
8.0.170.0050.00216.74
8.0.160.0040.00416.86
8.0.150.0000.00816.73
8.0.140.0040.00316.80
8.0.130.0000.00613.21
8.0.120.0070.00016.78
8.0.110.0030.00316.69
8.0.100.0080.00016.79
8.0.90.0040.00316.86
8.0.80.0070.00716.79
8.0.70.0040.00416.82
8.0.60.0000.00716.80
8.0.50.0040.00416.78
8.0.30.0120.00616.94
8.0.20.0120.00817.01
8.0.10.0050.00316.97
8.0.00.0100.01116.61
7.4.330.0000.00512.86
7.4.320.0030.00316.60
7.4.300.0000.00816.43
7.4.290.0000.00716.53
7.4.280.0000.01016.32
7.4.270.0030.00316.43
7.4.260.0040.00413.19
7.4.250.0030.00616.41
7.4.240.0030.00316.54
7.4.230.0080.00016.61
7.4.220.0030.01916.58
7.4.210.0070.00716.53
7.4.200.0040.00416.34
7.4.190.0070.00016.70
7.4.160.0130.00316.62
7.4.150.0060.01016.45
7.4.140.0130.00516.35
7.4.130.0120.01116.37
7.4.120.0100.00816.44
7.4.110.0100.00616.49
7.4.100.0100.01016.41
7.4.90.0100.01016.50
7.4.80.0070.01019.39
7.4.70.0210.00416.25
7.4.60.0130.00316.38
7.4.50.0000.00516.23
7.4.40.0030.00916.41
7.4.30.0130.00316.42
7.4.00.0100.00814.98
7.3.330.0060.00012.97
7.3.320.0060.00013.04
7.3.310.0000.00616.14
7.3.300.0000.00616.13
7.3.290.0070.01316.09
7.3.280.0090.00716.17
7.3.270.0100.00716.36
7.3.260.0120.00616.19
7.3.250.0080.01416.48
7.3.240.0170.00716.53
7.3.230.0110.00816.40
7.3.210.0070.01016.13
7.3.200.0100.00716.10
7.3.190.0110.00716.39
7.3.180.0090.00616.24
7.3.170.0100.01016.33
7.3.160.0080.00816.07
7.3.120.0050.01314.80
7.3.110.0030.01014.62
7.3.100.0060.01214.85
7.3.90.0110.00314.72
7.3.80.0040.00714.70
7.3.70.0060.00614.68
7.3.60.0130.00314.77
7.3.50.0070.00714.60
7.3.40.0030.01014.77
7.3.30.0110.00414.81
7.3.20.0040.01116.44
7.3.10.0040.01116.61
7.3.00.0040.01216.67
7.2.330.0190.00716.50
7.2.320.0140.00616.25
7.2.310.0030.02016.37
7.2.300.0120.01216.25
7.2.290.0060.00916.55
7.2.250.0100.01015.04
7.2.240.0070.01015.09
7.2.230.0030.01014.97
7.2.220.0090.00914.63
7.2.210.0040.01114.73
7.2.200.0090.00314.83
7.2.190.0070.00714.85
7.2.180.0030.01014.94
7.2.170.0080.00414.85
7.2.00.0030.01019.01
7.1.330.0030.01015.89
7.1.320.0070.01015.55
7.1.310.0030.01015.61
7.1.300.0000.01315.77
7.1.290.0160.00015.51
7.1.280.0040.01115.63
7.1.270.0070.01015.71
7.1.260.0040.00415.74
7.1.100.0790.00315.97
7.1.70.0030.00616.55
7.1.60.0150.01119.40
7.1.50.0170.00716.99
7.1.00.0030.06322.26
7.0.200.0100.00714.66
7.0.140.0130.06322.00
7.0.120.0070.06021.95
7.0.60.0300.07719.90
7.0.50.0030.04717.89
7.0.40.0070.08320.08
7.0.30.0300.07020.20
7.0.20.0200.05720.21
7.0.10.0030.09020.20
7.0.00.0130.08020.12
5.6.280.0000.07720.88
5.6.210.0100.03320.52
5.6.200.0230.06318.23
5.6.190.0100.08320.64
5.6.180.0300.03720.64
5.6.170.0230.03320.52
5.6.160.0000.04320.49
5.6.150.0000.09018.08
5.6.140.0100.07718.07
5.6.130.0070.08718.11
5.6.120.0030.04321.09
5.6.110.0170.08021.00
5.6.100.0100.08020.96
5.6.90.0030.09320.96
5.6.80.0070.06320.37
5.5.350.0130.07320.42
5.5.340.0030.06018.02
5.5.330.0100.07320.40
5.5.320.0430.06320.21
5.5.310.0270.06720.20
5.5.300.0030.04017.99
5.5.290.0070.06717.96
5.5.280.0030.04020.65
5.5.270.0100.06720.97
5.5.260.0130.04320.86
5.5.250.0030.04320.55
5.5.240.4300.03020.36
5.4.450.0030.09019.41
5.4.440.0070.08019.23
5.4.430.0000.05719.11
5.4.420.0070.03719.42
5.4.410.0000.04719.11
5.4.400.0030.05018.81
5.4.390.0000.05719.08
5.4.380.0030.04319.12
5.4.370.0030.04019.08
5.4.360.0100.06019.08
5.4.350.0030.07018.80
5.4.340.0000.05319.00
5.4.320.0070.07719.14
5.4.310.0130.04318.79
5.4.300.0030.03719.00
5.4.290.0030.04018.91
5.4.280.0000.04319.11
5.4.270.0070.07319.18
5.4.260.0070.06719.00
5.4.250.0070.03718.78
5.4.240.0100.04319.17
5.4.230.0070.07019.07
5.4.220.0100.08019.00
5.4.210.0200.06318.78
5.4.200.0030.06719.17
5.4.190.0030.03719.14
5.4.180.0070.07318.99
5.4.170.0030.04019.17
5.4.160.0100.07719.15
5.4.150.0000.08719.16
5.4.140.0070.04316.23
5.4.130.0070.03716.15
5.4.120.0100.06716.36
5.4.110.0070.07316.41
5.4.100.0000.06016.23
5.4.90.0100.06716.40
5.4.80.0030.03716.39
5.4.70.0070.04016.39
5.4.60.0030.06316.32
5.4.50.0070.07316.57
5.4.40.0070.05716.25
5.4.30.0070.06716.27
5.4.20.0100.03716.12
5.4.10.0070.04716.33
5.4.00.0130.05315.70
5.3.290.0170.07014.64
5.3.280.0130.04714.47
5.3.270.0030.05714.50
5.3.260.0030.08314.62
5.3.250.0100.04014.62
5.3.240.0030.04314.58
5.3.230.0000.07014.52
5.3.220.0130.05314.58
5.3.210.0070.04314.58
5.3.200.0030.06714.49
5.3.190.0130.06014.67
5.3.180.0070.03714.65
5.3.170.0070.06714.50
5.3.160.0030.05314.57
5.3.150.0100.07314.50
5.3.140.0070.05714.64
5.3.130.0070.06714.52
5.3.120.0030.07014.37
5.3.110.0100.06014.52
5.3.100.0030.03713.96
5.3.90.0070.04713.95
5.3.80.0070.03313.95
5.3.70.0100.03313.97
5.3.60.0000.04013.95
5.3.50.0100.07713.88
5.3.40.0070.04313.87
5.3.30.0070.06313.83
5.3.20.0030.07313.63
5.3.10.0100.06313.58
5.3.00.0070.07013.60
5.2.170.0000.03711.23
5.2.160.0000.07011.08
5.2.150.0070.03311.07
5.2.140.0070.06711.08
5.2.130.0130.06011.11
5.2.120.0000.04311.25
5.2.110.0100.05711.09
5.2.100.0070.05711.05
5.2.90.0030.06011.09
5.2.80.0130.04311.17
5.2.70.0030.03011.00
5.2.60.0030.06711.03
5.2.50.0000.05311.00
5.2.40.0100.05711.00
5.2.30.0030.06311.00
5.2.20.0070.04711.00
5.2.10.0130.04711.00
5.2.00.0070.05011.00
5.1.60.0030.03711.00
5.1.50.0030.03311.00
5.1.40.0030.03311.00
5.1.30.0130.04711.00
5.1.20.0030.03011.00
5.1.10.0070.04011.00
5.1.00.0000.02711.00
5.0.50.0070.01711.00
5.0.40.0030.02711.00
5.0.30.0000.06711.00
5.0.20.0000.02011.00
5.0.10.0070.04011.00
5.0.00.0000.05011.00
4.4.90.0030.03311.00
4.4.80.0030.02011.00
4.4.70.0070.02711.00
4.4.60.0100.01711.00
4.4.50.0000.02011.00
4.4.40.0000.03011.00
4.4.30.0000.01711.00
4.4.20.0130.01311.00
4.4.10.0000.01711.00
4.4.00.0000.03011.00
4.3.110.0070.01311.00
4.3.100.0070.01011.00
4.3.90.0000.03011.00
4.3.80.0000.05711.00
4.3.70.0030.03011.00
4.3.60.0030.03311.00
4.3.50.0000.03311.00
4.3.40.0000.04711.00
4.3.30.0000.04011.00
4.3.20.0000.03711.00
4.3.10.0000.03311.00
4.3.00.0000.03711.00

preferences:
55.92 ms | 400 KiB | 5 Q