3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_array = array('z' => 'g', '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.0140.00716.34
8.3.50.0120.00517.31
8.3.40.0110.00318.54
8.3.30.0070.00718.48
8.3.20.0040.00418.58
8.3.10.0030.00520.47
8.3.00.0090.00017.38
8.2.180.0070.01116.38
8.2.170.0120.00322.96
8.2.160.0030.01320.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0000.00819.83
8.2.110.0090.00321.10
8.2.100.0090.00317.78
8.2.90.0040.00418.89
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0000.00717.80
8.2.50.0050.00318.07
8.2.40.0030.00518.16
8.2.30.0040.00418.05
8.2.20.0080.00017.63
8.2.10.0040.00417.48
8.2.00.0000.00717.71
8.1.280.0070.00725.92
8.1.270.0070.00024.66
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0090.00022.48
8.1.230.0100.00020.86
8.1.220.0030.00518.77
8.1.210.0030.00720.50
8.1.200.0060.00317.23
8.1.190.0040.00417.28
8.1.180.0000.00918.10
8.1.170.0000.00718.70
8.1.160.0070.00018.85
8.1.150.0040.00418.44
8.1.140.0040.00417.40
8.1.130.0000.00717.68
8.1.120.0040.00417.46
8.1.110.0000.00717.37
8.1.100.0080.00017.38
8.1.90.0000.00817.37
8.1.80.0050.00217.38
8.1.70.0000.00617.32
8.1.60.0000.00817.47
8.1.50.0000.00817.28
8.1.40.0000.00717.47
8.1.30.0040.00417.53
8.1.20.0000.00817.53
8.1.10.0000.00817.45
8.1.00.0040.00417.29
8.0.300.0030.00319.85
8.0.290.0000.00816.63
8.0.280.0070.00018.24
8.0.270.0000.00717.18
8.0.260.0030.00316.66
8.0.250.0040.00416.91
8.0.240.0000.01016.78
8.0.230.0050.00216.87
8.0.220.0070.00016.75
8.0.210.0040.00416.78
8.0.200.0060.00016.78
8.0.190.0040.00416.89
8.0.180.0000.00816.88
8.0.170.0060.00316.84
8.0.160.0030.00316.84
8.0.150.0000.00816.79
8.0.140.0070.00316.75
8.0.130.0000.00613.23
8.0.120.0050.00316.79
8.0.110.0040.00416.74
8.0.100.0000.00716.61
8.0.90.0030.00316.71
8.0.80.0150.00016.86
8.0.70.0000.00716.82
8.0.60.0050.00216.73
8.0.50.0040.00416.70
8.0.30.0090.00816.95
8.0.20.0110.00916.98
8.0.10.0040.00416.80
8.0.00.0060.01116.71
7.4.330.0050.00012.91
7.4.320.0030.00316.55
7.4.300.0030.00316.53
7.4.290.0030.00316.43
7.4.280.0060.00316.50
7.4.270.0040.00416.57
7.4.260.0000.00513.20
7.4.250.0020.00516.27
7.4.240.0030.00316.45
7.4.230.0030.00316.33
7.4.220.0060.01016.34
7.4.210.0080.00716.54
7.4.200.0030.00316.56
7.4.190.0000.00716.64
7.4.160.0060.00916.57
7.4.150.0150.00616.49
7.4.140.0090.00816.45
7.4.130.0070.01016.39
7.4.120.0090.01016.37
7.4.110.0070.01016.50
7.4.100.0100.01016.46
7.4.90.0120.01216.31
7.4.80.0090.00916.54
7.4.70.0150.00916.16
7.4.60.0140.00316.52
7.4.50.0030.00616.48
7.4.40.0060.00616.36
7.4.30.0060.01116.52
7.4.00.0080.00814.66
7.3.330.0000.00613.11
7.3.320.0050.00012.98
7.3.310.0000.00716.12
7.3.300.0070.00016.08
7.3.290.0100.01016.13
7.3.280.0090.00916.09
7.3.270.0100.01016.34
7.3.260.0160.00616.19
7.3.250.0130.00516.25
7.3.240.0070.01016.17
7.3.230.0120.00616.35
7.3.210.0090.00616.09
7.3.200.0100.01019.39
7.3.190.0070.01216.20
7.3.180.0120.00516.32
7.3.170.0060.00916.30
7.3.160.0060.01016.35
7.3.120.0100.00714.42
7.3.110.0130.00014.59
7.3.100.0030.01314.56
7.3.90.0040.01414.70
7.3.80.0070.00714.82
7.3.70.0000.01414.50
7.3.60.0030.00614.57
7.3.50.0030.00614.55
7.3.40.0090.00614.29
7.3.30.0040.01214.56
7.3.20.0090.00316.23
7.3.10.0110.00416.47
7.3.00.0090.00316.32
7.2.330.0170.00016.30
7.2.320.0100.00616.47
7.2.310.0110.01116.27
7.2.300.0090.00716.34
7.2.290.0150.00616.17
7.2.250.0090.00914.59
7.2.240.0090.00615.04
7.2.230.0130.00614.84
7.2.220.0060.00814.77
7.2.210.0030.00614.48
7.2.200.0060.00614.88
7.2.190.0060.00914.40
7.2.180.0070.00714.66
7.2.170.0090.00314.81
7.2.00.0030.00919.34
7.1.330.0110.00415.71
7.1.320.0070.00715.70
7.1.310.0070.00715.53
7.1.300.0060.01215.61
7.1.290.0090.00615.59
7.1.280.0070.01015.71
7.1.270.0070.01015.79
7.1.260.0080.00415.45
7.1.100.0000.01518.13
7.1.70.0070.00317.05
7.1.60.0060.01819.40
7.1.50.0070.01516.89
7.1.00.0000.07722.57
7.0.200.0100.00316.49
7.0.140.0030.07322.12
7.0.120.0130.05722.04
7.0.60.0130.07319.90
7.0.50.0130.06317.96
7.0.40.0070.08719.95
7.0.30.0470.07020.11
7.0.20.0230.05720.12
7.0.10.0100.08320.16
7.0.00.0100.07320.14
5.6.280.0130.06321.10
5.6.210.0100.07720.66
5.6.200.0070.08318.19
5.6.190.0000.08020.41
5.6.180.3570.04320.35
5.6.170.0230.06720.71
5.6.160.0170.07720.41
5.6.150.0100.07718.17
5.6.140.0100.05718.21
5.6.130.0070.08018.11
5.6.120.0030.06021.11
5.6.110.0130.07020.98
5.6.100.0070.06021.00
5.6.90.0100.07720.96
5.6.80.0230.06320.35
5.6.70.4270.03720.36
5.5.350.0070.07320.43
5.5.340.0070.05317.95
5.5.330.0100.08020.36
5.5.320.0200.08720.28
5.5.310.0430.07320.30
5.5.300.0070.08017.88
5.5.290.0200.05317.92
5.5.280.0030.04020.64
5.5.270.0030.08020.87
5.5.260.0030.09320.75
5.5.250.0130.07320.45
5.5.240.0030.04020.25
5.4.450.0130.07319.48
5.4.440.0030.08019.43
5.4.430.0070.04719.46
5.4.420.0030.08019.40
5.4.410.0070.07719.33
5.4.400.0200.04718.79
5.4.390.0170.06719.08
5.4.380.0070.04319.19
5.4.370.0070.08018.75
5.4.360.0030.04719.12
5.4.350.0030.06318.92
5.4.340.0100.08018.91
5.4.320.0100.04019.08
5.4.310.0070.05319.12
5.4.300.0170.06719.21
5.4.290.0070.07318.79
5.4.280.0200.05719.16
5.4.270.0100.07319.17
5.4.260.0070.07319.07
5.4.250.0070.05318.99
5.4.240.0070.04319.00
5.4.230.0100.06718.78
5.4.220.0130.07018.79
5.4.210.0070.05319.07
5.4.200.0000.05319.13
5.4.190.0100.07319.13
5.4.180.0130.04019.14
5.4.170.0100.05019.14
5.4.160.0070.07018.79
5.4.150.0000.05019.06
5.4.140.0070.03716.27
5.4.130.0130.06316.48
5.4.120.0030.08016.35
5.4.110.0070.06016.36
5.4.100.0070.05316.32
5.4.90.0130.06716.27
5.4.80.0000.05016.13
5.4.70.0070.07316.31
5.4.60.0000.07316.34
5.4.50.0130.06316.28
5.4.40.0030.06016.37
5.4.30.0100.06316.18
5.4.20.0070.07716.27
5.4.10.0070.07316.36
5.4.00.0030.03715.70
5.3.290.0030.04314.59
5.3.280.0070.04314.54
5.3.270.0100.05714.53
5.3.260.0030.06014.61
5.3.250.0100.05014.53
5.3.240.0000.05014.69
5.3.230.0070.05314.53
5.3.220.0030.05714.53
5.3.210.0070.04314.54
5.3.200.0030.04014.50
5.3.190.0130.06314.58
5.3.180.0030.06014.48
5.3.170.0130.05314.52
5.3.160.0100.06314.35
5.3.150.0100.07314.48
5.3.140.0070.06714.51
5.3.130.0130.06314.55
5.3.120.0070.07314.55
5.3.110.0070.05314.56
5.3.100.0070.03714.00
5.3.90.0100.05313.94
5.3.80.0100.03713.94
5.3.70.0070.06313.80
5.3.60.0070.07713.82
5.3.50.0000.05313.87
5.3.40.0100.07313.87
5.3.30.0000.04013.83
5.3.20.0070.07013.80
5.3.10.0000.05313.47
5.3.00.0100.04013.60
5.2.170.0030.07011.31
5.2.160.0070.06011.22
5.2.150.0000.05011.02
5.2.140.0030.03711.15
5.2.130.0070.03711.11
5.2.120.0000.05011.09
5.2.110.0100.03710.98
5.2.100.0070.06310.95
5.2.90.0130.04711.07
5.2.80.0030.03711.06
5.2.70.0000.03311.27
5.2.60.0030.03710.98
5.2.50.0030.06010.95
5.2.40.0070.05711.07
5.2.30.0030.04310.89
5.2.20.0070.04310.89
5.2.10.0100.06310.86
5.2.00.0030.05010.61
5.1.60.0100.0309.89
5.1.50.0000.03710.00
5.1.40.0070.0579.99
5.1.30.0030.02710.41
5.1.20.0030.05310.24
5.1.10.0130.04710.04
5.1.00.0100.0509.97
5.0.50.0070.0438.45
5.0.40.0030.0278.40
5.0.30.0070.0678.27
5.0.20.0100.0378.19
5.0.10.0100.0378.13
5.0.00.0100.0578.17
4.4.90.0030.0337.88
4.4.80.0030.0377.88
4.4.70.0000.0407.88
4.4.60.0000.0177.88
4.4.50.0030.0377.88
4.4.40.0000.0377.88
4.4.30.0000.0377.88
4.4.20.0030.0377.88
4.4.10.0000.0377.88
4.4.00.0100.0507.88
4.3.110.0030.0337.88
4.3.100.0030.0207.88
4.3.90.0030.0137.88
4.3.80.0030.0507.88
4.3.70.0070.0337.88
4.3.60.0070.0337.88
4.3.50.0000.0237.88
4.3.40.0030.0377.88
4.3.30.0030.0137.88
4.3.20.0000.0207.88
4.3.10.0030.0137.88
4.3.00.0000.0137.88

preferences:
51.37 ms | 401 KiB | 5 Q