3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1 => '5ive', 'jim' => 'bob', 4 => 5); echo 'Pointer is set to: ' . current($array) . "\n"; var_dump(array_slice($array, 0, 1)); echo 'first item: ' . array_slice($array, 0, 1)[0] . "\n"; echo 'Pointer is set to: ' . current($array) . "\n"; var_dump($array);

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.0090.00618.36
8.3.50.0070.00721.98
8.3.40.0040.01518.61
8.3.30.0090.00618.71
8.3.20.0140.00418.44
8.3.10.0120.00321.15
8.3.00.0040.00419.56
8.2.180.0150.00716.38
8.2.170.0110.00422.96
8.2.160.0130.00318.96
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00021.18
8.2.110.0030.00622.07
8.2.100.0080.00417.72
8.2.90.0050.00319.21
8.2.80.0040.00419.38
8.2.70.0000.00817.63
8.2.60.0000.00817.78
8.2.50.0040.00418.07
8.2.40.0050.00318.22
8.2.30.0030.00519.49
8.2.20.0050.00217.59
8.2.10.0070.00017.68
8.2.00.0080.00017.76
8.1.280.0100.00725.92
8.1.270.0050.00323.99
8.1.260.0110.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.55
8.1.230.0080.00420.89
8.1.220.0050.00318.77
8.1.210.0080.00018.96
8.1.200.0060.00317.35
8.1.190.0090.00017.63
8.1.180.0030.00618.10
8.1.170.0000.00818.56
8.1.160.0070.00018.83
8.1.150.0050.00518.69
8.1.140.0080.00017.48
8.1.130.0070.00017.82
8.1.120.0000.00717.40
8.1.110.0000.00717.36
8.1.100.0030.00317.32
8.1.90.0050.00317.44
8.1.80.0000.00717.38
8.1.70.0030.00317.36
8.1.60.0000.01017.57
8.1.50.0000.00717.38
8.1.40.0030.00517.41
8.1.30.0000.00817.59
8.1.20.0000.00917.64
8.1.10.0020.00517.63
8.1.00.0000.00717.57
8.0.300.0000.00720.03
8.0.290.0040.00417.05
8.0.280.0000.00718.44
8.0.270.0050.00217.25
8.0.260.0030.00316.77
8.0.250.0000.00716.95
8.0.240.0000.00716.95
8.0.230.0040.00417.01
8.0.220.0030.00316.76
8.0.210.0000.00716.90
8.0.200.0070.00016.96
8.0.190.0030.00516.93
8.0.180.0040.00416.91
8.0.170.0000.00816.89
8.0.160.0000.00716.79
8.0.150.0100.00016.70
8.0.140.0000.00816.83
8.0.130.0040.00413.28
8.0.120.0050.00316.77
8.0.110.0020.00516.78
8.0.100.0000.00816.73
8.0.90.0000.00816.72
8.0.80.0120.00316.82
8.0.70.0070.00016.76
8.0.60.0000.00716.86
8.0.50.0040.00416.67
8.0.30.0110.00616.88
8.0.20.0110.00817.40
8.0.10.0070.00017.06
8.0.00.0060.01316.77
7.4.330.0050.00016.83
7.4.320.0030.00316.46
7.4.300.0000.00716.54
7.4.290.0050.00216.55
7.4.280.0030.00316.33
7.4.270.0000.00716.52
7.4.260.0030.00313.21
7.4.250.0080.00016.42
7.4.240.0030.00316.49
7.4.230.0070.00016.56
7.4.220.0160.00616.50
7.4.210.0090.00616.55
7.4.200.0070.00016.33
7.4.190.0070.00016.46
7.4.160.0090.00616.36
7.4.150.0060.01217.40
7.4.140.0060.01117.86
7.4.130.0120.00816.38
7.4.120.0110.00616.41
7.4.110.0070.01116.55
7.4.100.0100.01316.49
7.4.90.0170.00016.55
7.4.80.0030.01419.39
7.4.70.0080.00816.55
7.4.60.0120.00916.45
7.4.50.0000.00916.61
7.4.40.0040.01122.77
7.4.30.0130.00716.39
7.4.00.0070.01114.89
7.3.330.0030.00313.00
7.3.320.0040.00413.06
7.3.310.0050.00216.32
7.3.300.0060.00016.26
7.3.290.0000.01316.30
7.3.280.0100.00616.24
7.3.270.0080.00917.40
7.3.260.0040.01418.24
7.3.250.0070.01016.42
7.3.240.0060.01216.30
7.3.230.0170.00016.50
7.3.210.0130.00316.49
7.3.200.0060.01219.39
7.3.190.0150.00316.39
7.3.180.0110.00516.32
7.3.170.0100.00616.32
7.3.160.0090.00616.43
7.3.120.0040.00814.71
7.3.10.0060.00616.25
7.3.00.0000.01516.41
7.2.330.0110.01016.76
7.2.320.0110.01116.68
7.2.310.0310.03116.70
7.2.300.0040.01316.58
7.2.290.0080.00816.63
7.2.130.0030.00916.84
7.2.120.0030.01017.00
7.2.110.0110.00416.68
7.2.100.0040.00716.79
7.2.90.0060.00916.97
7.2.80.0000.01716.93
7.2.70.0040.00417.01
7.2.60.0110.00216.89
7.2.50.0040.01216.95
7.2.40.0080.00617.02
7.2.30.0070.00416.92
7.2.20.0080.00416.78
7.2.10.0030.00916.93
7.2.00.0000.01118.17
7.1.250.0030.00615.48
7.1.200.0060.00615.83
7.1.100.0040.01118.09
7.1.70.0550.00616.11
7.1.60.0500.01116.11
7.1.50.0530.00716.11
7.1.40.0700.00616.11
7.1.30.0760.00616.11
7.1.20.0820.00916.11
7.1.10.0600.01416.11
7.1.00.0470.01416.11
7.0.200.0470.01316.11
7.0.190.0770.01016.11
7.0.180.0790.00416.11
7.0.170.0870.00016.11
7.0.160.0830.00616.11
7.0.150.0480.00616.11
7.0.140.0670.00416.11
7.0.130.0500.00816.11
7.0.120.0500.01016.11
7.0.110.0570.00716.11
7.0.100.0480.00416.11
7.0.90.0490.00716.11
7.0.80.0450.01116.11
7.0.70.1830.00316.11
7.0.60.0900.00716.11
7.0.50.0830.00316.11
7.0.40.0040.00816.11
7.0.30.0090.00316.11
7.0.20.0130.00516.11
7.0.10.0040.00816.11
7.0.00.0000.01516.11
5.6.300.0170.07920.59
5.6.290.0060.04620.73
5.6.280.0100.04321.03
5.6.270.0110.04221.08
5.6.260.0100.04720.94
5.6.250.0200.03320.86
5.6.240.0140.04120.80
5.6.230.0080.04320.95
5.6.220.0120.03920.92
5.6.210.0100.04821.04
5.6.200.0240.05420.86
5.6.190.0070.04620.93
5.6.180.0130.04220.97
5.6.170.0040.04720.98
5.6.160.0140.03620.79
5.6.150.0080.04620.82
5.6.140.0100.04120.91
5.6.130.0070.04320.85
5.6.120.0040.04820.75
5.6.110.0040.05221.00
5.6.100.0040.04920.89
5.6.90.0040.05120.74
5.6.80.0070.08220.23
5.6.70.0030.04220.09
5.6.60.0040.04520.12
5.6.50.0030.04320.21
5.6.40.0100.04320.32
5.6.30.0150.03420.37
5.6.20.0070.04120.36
5.6.10.0140.03620.31
5.6.00.0040.05120.37
5.5.380.0150.03117.48
5.5.370.0100.04517.41
5.5.360.0160.04617.40
5.5.350.0150.03917.47
5.5.340.0130.03817.66
5.5.330.0000.05217.84
5.5.320.0070.03917.94
5.5.310.0060.04117.86
5.5.300.0100.03717.86
5.5.290.0140.04917.93
5.5.280.0120.03717.73
5.5.270.0100.04118.03
5.5.260.0100.04117.82
5.5.250.0030.05017.79
5.5.240.0240.03017.36
5.5.230.0040.05017.46
5.5.220.0030.06417.46
5.5.210.0030.04017.43
5.5.200.0060.05817.30
5.5.190.0090.03617.36
5.5.180.0030.04817.43
5.5.160.0030.05417.37
5.5.150.0110.03117.34
5.5.140.0070.03817.29
5.5.130.0000.04117.30
5.5.120.0070.03717.08
5.5.110.0100.03817.29
5.5.100.0070.04117.14
5.5.90.0090.03317.27
5.5.80.0000.04517.26
5.5.70.0030.05317.07
5.5.60.0060.03717.19
5.5.50.0030.04117.33
5.5.40.0000.04417.17
5.5.30.0200.03317.21
5.5.20.0030.04716.99
5.5.10.0030.03917.29
5.5.00.0000.04517.25
5.4.450.0130.03919.28
5.4.440.0090.04119.18
5.4.430.0140.05319.23
5.4.420.0120.03719.50
5.4.410.0070.04319.19
5.4.400.0100.03418.89
5.4.390.0090.03418.85
5.4.380.0070.03718.99
5.4.370.0060.03519.05
5.4.360.0060.03818.98
5.4.350.0230.03618.98
5.4.340.0030.04219.14
5.4.320.0030.04419.07
5.4.310.0000.04118.99
5.4.300.0070.03318.97
5.4.290.0030.04018.98
5.4.280.0000.04318.98
5.4.270.0040.06018.89
5.4.260.0000.03918.95
5.4.250.0000.04418.81
5.4.240.0000.04318.94
5.4.230.0000.04518.86
5.4.220.0030.04119.05
5.4.210.0130.03218.97
5.4.200.0030.04518.98
5.4.190.0060.04318.87
5.4.180.0070.03718.89
5.4.170.0070.03919.12
5.4.160.0030.04019.09
5.4.150.0060.04319.04
5.4.140.0100.03716.40
5.4.130.0030.03416.64
5.4.120.0030.03616.48
5.4.110.0030.03716.68
5.4.100.0030.03416.63
5.4.90.0090.03216.63
5.4.80.0040.03616.60
5.4.70.0060.03216.33
5.4.60.0030.06116.59
5.4.50.0030.03716.39
5.4.40.0030.04816.71
5.4.30.0030.03716.62
5.4.20.0070.03116.63
5.4.10.0000.04516.33
5.4.00.0030.04216.11
5.3.290.0000.04416.11
5.3.280.0130.04316.11
5.3.270.0000.04516.11
5.3.260.0060.03416.11
5.3.250.0070.04216.11
5.3.240.0000.03916.11
5.3.230.0000.05116.11
5.3.220.0000.04016.11
5.3.210.0000.04116.11
5.3.200.0040.03916.11
5.3.190.0070.03416.11
5.3.180.0060.03816.11
5.3.170.0030.03816.11
5.3.160.0040.03616.11
5.3.150.0100.03216.11
5.3.140.0130.04416.11
5.3.130.0100.03316.11
5.3.120.0030.05116.11
5.3.110.0070.04416.11
5.3.100.0100.04016.11
5.3.90.0000.04116.11
5.3.80.0000.04116.11
5.3.70.0060.04516.11
5.3.60.0090.03016.11
5.3.50.0040.03716.11
5.3.40.0100.04316.11
5.3.30.0060.04516.11
5.3.20.0030.03616.11
5.3.10.0100.04016.11
5.3.00.0030.03416.11
5.2.170.0090.02516.11
5.2.160.0160.03816.11
5.2.150.0130.02916.11
5.2.140.0000.03316.11
5.2.130.0030.03016.11
5.2.120.0070.02716.11
5.2.110.0030.02916.11
5.2.100.0030.03016.11
5.2.90.0060.03116.11
5.2.80.0000.03116.11
5.2.70.0120.03116.11
5.2.60.0030.04016.11
5.2.50.0030.04016.11
5.2.40.0000.03016.11
5.2.30.0070.02616.11
5.2.20.0110.02816.11
5.2.10.0070.02716.11
5.2.00.0090.02416.11
5.1.60.0000.02716.11
5.1.50.0070.02016.11
5.1.40.0030.03816.11
5.1.30.0000.03016.11
5.1.20.0000.03116.11
5.1.10.0060.02116.11
5.1.00.0000.03116.11
5.0.50.0040.02116.11
5.0.40.0070.02116.11
5.0.30.0000.03416.11
5.0.20.0030.01816.11
5.0.10.0000.02216.11
5.0.00.0000.03216.11
4.4.90.0060.03716.11
4.4.80.0030.01416.11
4.4.70.0000.03016.11
4.4.60.0030.02016.11
4.4.50.0050.01516.11
4.4.40.0030.02516.11
4.4.30.0030.03816.11
4.4.20.0030.02116.11
4.4.10.0000.01916.11
4.4.00.0000.02816.11
4.3.110.0030.01716.11
4.3.100.0000.01616.11
4.3.90.0000.03016.11
4.3.80.0000.04816.11
4.3.70.0140.01416.11
4.3.60.0030.02116.11
4.3.50.0000.01716.11
4.3.40.0000.03916.11
4.3.30.0000.02316.11
4.3.20.0000.01916.11
4.3.10.0000.03916.11
4.3.00.0030.02016.11

preferences:
52.57 ms | 400 KiB | 5 Q