3v4l.org

run code in 300+ PHP versions simultaneously
<?php $in = array(); for($i = 1; $i <=5; $i++) { $in[] = i; } $res = array();// Array where we will write result $t = &$res; // Link to first level foreach ($in as $k) { // Walk through source array if (empty($t[$k])) { // Check if current level has required key $t[$k] = array(); // If does not, create empty array there $t = &$t[$k]; // And link to it now. So each time it is link to deepest level. } } unset($t); // Drop link to last (most deep) level var_dump($res);

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.0100.01316.71
8.3.50.0150.00318.20
8.3.40.0080.01118.72
8.3.30.0070.00718.58
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.180.0160.00625.92
8.2.170.0140.00719.08
8.2.160.0140.00022.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00026.16
8.2.110.0060.00320.52
8.2.100.0080.00417.78
8.2.90.0050.00319.07
8.2.80.0080.00017.97
8.2.70.0090.00017.50
8.2.60.0050.00717.80
8.2.50.0090.00018.07
8.2.40.0000.00819.82
8.2.30.0000.00718.06
8.2.20.0040.00417.95
8.2.10.0000.00719.18
8.2.00.0040.00419.22
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.88
8.1.230.0070.00420.87
8.1.220.0090.00017.79
8.1.210.0090.00018.77
8.1.200.0040.00717.48
8.1.190.0050.00317.35
8.1.180.0050.00318.10
8.1.170.0080.00018.39
8.1.160.0040.00419.06
8.1.150.0050.00318.89
8.1.140.0040.00418.81
8.1.130.0030.00620.14
8.1.120.0050.00317.52
8.1.110.0000.00817.48
8.1.100.0050.00217.39
8.1.90.0040.00417.49
8.1.80.0040.00417.44
8.1.70.0000.00717.50
8.1.60.0000.00717.54
8.1.50.0000.00817.44
8.1.40.0020.00517.52
8.1.30.0000.00817.48
8.1.20.0030.00617.65
8.1.10.0030.00517.47
8.1.00.0000.00917.46
8.0.300.0020.00518.77
8.0.290.0070.00016.75
8.0.280.0040.00418.43
8.0.270.0000.00717.98
8.0.260.0070.00018.56
8.0.250.0060.00017.00
8.0.240.0040.00417.02
8.0.230.0000.00816.98
8.0.220.0030.00316.96
8.0.210.0030.00316.84
8.0.200.0030.00516.90
8.0.190.0040.00417.07
8.0.180.0000.00717.00
8.0.170.0040.00417.03
8.0.160.0060.00316.98
8.0.150.0000.00816.78
8.0.140.0080.00016.80
8.0.130.0060.00013.36
8.0.120.0080.00016.80
8.0.110.0040.00416.92
8.0.100.0040.00417.01
8.0.90.0000.00716.98
8.0.80.0090.01016.93
8.0.70.0000.00716.98
8.0.60.0000.00816.91
8.0.50.0040.00416.86
8.0.30.0260.00316.78
8.0.20.0300.00316.90
8.0.10.0300.00417.04
8.0.00.0190.01316.89
7.4.330.0030.00315.55
7.4.320.0000.00616.61
7.4.300.0070.00016.59
7.4.290.0070.00016.39
7.4.280.0030.00616.63
7.4.270.0080.00016.51
7.4.260.0000.00613.21
7.4.250.0030.00616.48
7.4.240.0010.00616.46
7.4.230.0000.00816.41
7.4.220.0080.00016.34
7.4.210.0130.00316.68
7.4.200.0070.00016.57
7.4.160.0160.01316.54
7.4.150.0250.00716.43
7.4.140.0270.00016.49
7.4.130.0240.00616.20
7.4.120.0210.00816.38
7.4.110.0340.00016.43
7.4.100.0190.01316.34
7.4.90.0240.00716.25
7.4.80.0300.00016.27
7.4.70.0180.01216.42
7.4.60.0220.01116.37
7.4.50.0140.01716.37
7.4.40.0240.00716.22
7.4.30.0180.01116.34
7.4.20.0260.00316.26
7.4.10.0240.01216.37
7.4.00.0200.01016.25
7.3.330.0050.00516.38
7.3.320.0050.00013.13
7.3.310.0060.00016.23
7.3.300.0030.00316.39
7.3.290.0090.00716.39
7.3.280.0150.01516.14
7.3.270.0200.00916.23
7.3.260.0140.01716.19
7.3.250.0190.01516.30
7.3.240.0270.00816.27
7.3.230.0200.00916.19
7.3.220.0180.01316.17
7.3.210.0160.01716.18
7.3.200.0190.01616.33
7.3.190.0150.01516.15
7.3.180.0230.00516.16
7.3.170.0240.01216.25
7.3.160.0200.01016.18
7.3.150.0180.01216.28
7.3.140.0280.00416.32
7.3.130.0240.00816.32
7.3.120.0180.01016.20
7.3.110.0240.00316.19
7.3.100.0200.00716.22
7.3.90.0210.00616.59
7.3.80.0130.01816.23
7.3.70.0160.01216.32
7.3.60.0190.01316.37
7.3.50.0210.00816.33
7.3.40.0170.01116.35
7.3.30.0230.00716.27
7.3.20.0230.00416.26
7.3.10.0240.00316.30
7.3.00.0200.01016.23

preferences:
68.96 ms | 400 KiB | 5 Q