3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = ["first", "second", "third"]; $array = []; foreach(array_reverse($keys) as $key) { $temp = $array; unset($array[key($array)]); $array[$key] = $temp; } $array['first']['second']['third'] = 'value'; print_r($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.0060.00918.55
8.3.50.0180.00718.02
8.3.40.0040.01118.54
8.3.30.0110.00418.66
8.3.20.0040.00421.89
8.3.10.0080.00023.48
8.3.00.0080.00020.84
8.2.180.0090.00918.32
8.2.170.0120.00322.96
8.2.160.0070.00722.13
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00821.06
8.2.110.0120.00619.33
8.2.100.0120.00017.91
8.2.90.0040.00418.22
8.2.80.0080.00319.09
8.2.70.0120.00017.63
8.2.60.0070.00317.93
8.2.50.0050.00318.07
8.2.40.0050.00320.02
8.2.30.0050.00218.17
8.2.20.0000.00818.15
8.2.10.0000.00719.29
8.2.00.0000.00719.16
8.1.280.0110.00725.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00322.17
8.1.230.0070.00320.91
8.1.220.0080.00017.79
8.1.210.0080.00018.91
8.1.200.0060.00317.35
8.1.190.0060.00317.36
8.1.180.0000.00918.10
8.1.170.0000.00718.77
8.1.160.0000.00718.82
8.1.150.0070.00018.85
8.1.140.0050.00322.05
8.1.130.0030.00320.13
8.1.120.0000.00717.46
8.1.110.0100.00017.45
8.1.100.0110.00017.36
8.1.90.0000.00717.41
8.1.80.0040.00417.32
8.1.70.0030.00517.51
8.1.60.0000.00817.47
8.1.50.0040.00417.43
8.1.40.0030.00617.53
8.1.30.0000.00817.48
8.1.20.0020.00517.52
8.1.10.0040.00417.47
8.1.00.0000.00817.46
8.0.300.0000.00720.10
8.0.290.0040.00416.75
8.0.280.0000.00718.38
8.0.270.0040.00417.18
8.0.260.0000.00718.45
8.0.250.0060.00017.01
8.0.240.0080.00016.86
8.0.230.0070.00016.99
8.0.220.0060.00316.89
8.0.210.0030.00316.86
8.0.200.0030.00616.82
8.0.190.0090.00016.97
8.0.180.0070.00016.94
8.0.170.0030.00616.96
8.0.160.0000.00816.78
8.0.150.0030.00416.79
8.0.140.0040.00416.78
8.0.130.0040.00413.27
8.0.120.0050.00316.86
8.0.110.0000.00716.78
8.0.100.0040.00416.82
8.0.90.0070.00016.91
8.0.80.0060.00916.89
8.0.70.0000.00716.75
8.0.60.0040.00416.76
8.0.50.0050.00216.82
8.0.30.0130.01017.23
8.0.20.0100.00917.40
8.0.10.0030.00517.06
8.0.00.0160.00916.78
7.4.330.0000.00515.55
7.4.320.0000.00616.45
7.4.300.0060.00016.65
7.4.290.0020.00516.42
7.4.280.0100.00016.48
7.4.270.0070.00016.48
7.4.260.0030.00316.49
7.4.250.0000.00716.46
7.4.240.0050.00216.61
7.4.230.0030.00316.57
7.4.220.0050.00216.43
7.4.210.0090.00816.50
7.4.200.0030.00316.64
7.4.160.0110.00416.50
7.4.140.0140.00817.86
7.4.130.0120.00916.54
7.4.120.0080.01316.59
7.4.110.0100.01316.52
7.4.100.0090.00916.50
7.4.90.0130.00316.51
7.4.80.0030.01319.39
7.4.70.0070.01016.52
7.4.60.0070.01016.49
7.4.50.0060.00916.51
7.4.40.0060.00916.70
7.4.00.0070.01014.85
7.3.330.0060.00013.13
7.3.320.0000.00613.12
7.3.310.0000.00816.34
7.3.300.0030.00316.23
7.3.290.0030.00316.38
7.3.280.0100.01016.35
7.3.260.0080.00916.36
7.3.240.0070.01116.41
7.3.230.0150.00416.26
7.3.210.0060.01016.34
7.3.200.0070.01016.69
7.3.190.0070.01016.50
7.3.180.0030.01216.44
7.3.170.0060.01316.49
7.3.160.0030.01216.30
7.3.00.0540.01014.65
7.2.330.0070.01316.64
7.2.320.0110.00516.50
7.2.310.0100.00616.59
7.2.300.0100.00716.76
7.2.290.0110.00616.62
7.2.130.0830.00314.88
7.2.120.0770.00014.98
7.2.110.0450.00315.21
7.2.100.0390.01014.71
7.2.90.0610.00615.06
7.2.80.0470.00314.97
7.2.70.1040.00315.08
7.2.60.0480.00315.21
7.2.50.0480.00015.08
7.2.40.0620.00015.23
7.2.30.0660.01315.25
7.2.20.0530.00014.96
7.2.10.0450.01015.16
7.2.00.0560.00615.14
7.1.250.0420.01313.94

preferences:
31.17 ms | 400 KiB | 5 Q