3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["a" => "one", "b" => "two", "c" => "three"]; if (!function_exists("array_key_last")) { echo "Please upgrade to php 7.3"; } else { echo "First Key: " , key($array) , "\n"; echo "Last Key: " , array_key_last($array) , "\n"; next($array); echo "Second Key: " , key($array) , "\n"; echo "Last Key: " , array_key_last($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.4.20.0060.00620.51
8.4.10.0130.00719.43
8.3.150.0090.00016.49
8.3.140.0030.00518.98
8.3.130.0040.00418.27
8.3.120.0080.00018.92
8.3.110.0060.00316.38
8.3.100.0060.00316.52
8.3.90.0090.00626.77
8.3.80.0060.00317.97
8.3.70.0140.00716.63
8.3.60.0150.00318.43
8.3.50.0130.00317.11
8.3.40.0090.00618.63
8.3.30.0070.00718.54
8.3.20.0060.00318.59
8.3.10.0040.00423.54
8.3.00.0070.00021.90
8.2.270.0090.00916.54
8.2.260.0070.01116.56
8.2.250.0030.00616.92
8.2.240.0030.00618.88
8.2.230.0000.00920.94
8.2.220.0030.00637.54
8.2.210.0110.00726.77
8.2.200.0030.00616.50
8.2.190.0140.00416.58
8.2.180.0170.00316.88
8.2.170.0140.00322.96
8.2.160.0070.00719.33
8.2.150.0050.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00219.89
8.2.110.0030.00619.27
8.2.100.0110.00017.78
8.2.90.0040.00417.63
8.2.80.0000.00818.79
8.2.70.0000.00817.75
8.2.60.0090.00017.50
8.2.50.0050.00317.55
8.2.40.0000.00819.48
8.2.30.0040.00417.98
8.2.20.0070.00018.03
8.2.10.0040.00418.36
8.2.00.0000.00719.42
8.1.310.0040.00416.73
8.1.300.0060.00320.37
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0040.00420.71
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00419.20
8.1.230.0110.00017.77
8.1.220.0070.00017.74
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0040.00417.22
8.1.180.0080.00018.10
8.1.170.0000.00917.62
8.1.160.0040.00418.80
8.1.150.0040.00418.83
8.1.140.0050.00418.89
8.1.130.0000.00717.40
8.1.120.0000.00717.52
8.1.110.0000.00717.42
8.1.100.0040.00417.53
8.1.90.0050.00317.44
8.1.80.0040.00417.35
8.1.70.0040.00417.44
8.1.60.0040.00417.60
8.1.50.0050.00317.54
8.1.40.0000.00717.46
8.1.30.0050.00317.72
8.1.20.0070.00017.49
8.1.10.0090.00017.53
8.1.00.0000.00717.34
8.0.300.0040.00418.77
8.0.290.0050.00316.63
8.0.280.0030.00318.46
8.0.270.0030.00316.82
8.0.260.0030.00316.75
8.0.250.0070.00016.90
8.0.240.0040.00416.89
8.0.230.0030.00316.89
8.0.220.0000.00716.88
8.0.210.0000.00716.91
8.0.200.0000.00816.96
8.0.190.0030.00516.86
8.0.180.0020.00516.82
8.0.170.0080.00016.92
8.0.160.0000.00716.73
8.0.150.0040.00416.90
8.0.140.0000.00716.91
8.0.130.0030.00313.29
8.0.120.0040.00416.82
8.0.110.0000.00816.72
8.0.100.0000.00816.79
8.0.90.0000.00716.96
8.0.80.0110.00816.86
8.0.70.0040.00416.84
8.0.60.0050.00316.79
8.0.50.0020.00516.73
8.0.30.0060.01117.17
8.0.20.0100.01017.40
8.0.10.0070.00016.91
8.0.00.0170.00416.77
7.4.330.0050.00015.55
7.4.320.0030.00316.58
7.4.300.0030.00316.53
7.4.290.0060.00016.42
7.4.280.0060.00316.43
7.4.270.0020.00416.44
7.4.260.0060.00316.48
7.4.250.0040.00416.42
7.4.240.0000.00716.48
7.4.230.0040.00416.71
7.4.220.0050.00316.57
7.4.210.0110.00716.42
7.4.200.0030.00316.35
7.4.160.0080.01116.45
7.4.140.0080.01217.86
7.4.130.0060.01216.48
7.4.120.0120.00616.41
7.4.110.0060.01016.57
7.4.100.0150.00416.39
7.4.90.0130.00416.59
7.4.80.0130.00319.39
7.4.70.0130.00316.36
7.4.60.0030.01216.46
7.4.50.0120.00316.46
7.4.40.0050.01116.61
7.4.00.0030.01214.70
7.3.330.0020.00212.99
7.3.320.0030.00313.07
7.3.310.0070.00015.97
7.3.300.0070.00016.05
7.3.290.0080.00016.18
7.3.280.0070.00916.15
7.3.260.0100.01316.30
7.3.240.0120.00616.24
7.3.230.0120.01216.50
7.3.210.0070.01016.26
7.3.200.0110.00616.14
7.3.190.0100.00716.30
7.3.180.0120.00416.11
7.3.170.0050.01116.27
7.3.160.0070.01016.10
7.3.10.0070.00716.33
7.3.00.0090.00316.54
7.2.330.0090.00916.55
7.2.320.0130.01016.53
7.2.310.0080.01416.17
7.2.300.0130.00316.36
7.2.290.0070.00716.24
7.2.130.0040.01116.75
7.2.120.0060.00916.70
7.2.110.0100.00616.32
7.2.100.0070.00716.69
7.2.90.0450.00615.57
7.2.80.0340.00515.72
7.2.70.0320.00815.78
7.2.60.0510.00915.70
7.2.50.0490.00515.76
7.2.40.0540.00815.58
7.2.30.0100.00415.95
7.2.20.0670.00515.85
7.2.10.0420.00815.84
7.2.00.0620.00815.78
7.1.250.0030.01315.38
7.1.210.0690.01013.71
7.1.200.0670.01013.58
7.1.190.0720.00313.91
7.1.180.0700.00913.40
7.1.170.1070.00613.78
7.1.160.1860.01013.78
7.1.150.0900.00313.57
7.1.140.1090.01013.58
7.1.130.0780.00713.80
7.1.120.1040.00713.68
7.1.110.0770.01013.92
7.1.100.1070.00713.91
7.1.90.0660.00313.78
7.1.80.0740.00613.64
7.1.70.0710.01313.82
7.1.60.0940.01031.80
7.1.50.0990.00331.39
7.1.40.0950.00731.76
7.1.30.1320.00731.72
7.1.20.1200.01731.44
7.1.10.1000.00913.34
7.1.00.0860.00313.67

preferences:
65.89 ms | 403 KiB | 5 Q