3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ['level', 'sub', 'item']; $arr = array_reverse($arr); $new =[]; foreach($arr as $key => $item){ if($key ==0){ $new = [$item => []]; }else{ $new = [$item => $new]; } } $other = array ( 'level' => array ( 'sub' => array ( 'AnotherItem' => array ( ), ), ), ); $new = array_merge_recursive($new, $other); var_export($new);

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.5.30.0110.00619.53
8.5.20.0100.00419.59
8.5.10.0090.00816.69
8.5.00.0130.00919.93
8.4.180.0140.00822.05
8.4.170.0140.00820.33
8.4.160.0140.00822.96
8.4.150.0070.00516.89
8.4.140.0070.01417.46
8.4.130.0140.00617.59
8.4.120.0110.00820.50
8.4.110.0060.00322.26
8.4.100.0090.00517.90
8.4.90.0080.01218.32
8.4.80.0100.01017.61
8.4.70.0160.00417.45
8.4.60.0120.01018.56
8.4.50.0130.00817.54
8.4.40.0160.00319.29
8.4.30.0060.00317.48
8.4.20.0070.01420.56
8.4.10.0120.00320.45
8.3.300.0150.00920.66
8.3.290.0130.00720.81
8.3.280.0120.00718.41
8.3.270.0090.01316.74
8.3.260.0100.01016.57
8.3.250.0030.00718.94
8.3.240.0070.01216.65
8.3.230.0100.00916.75
8.3.220.0130.00517.41
8.3.210.0050.01016.85
8.3.200.0040.00416.52
8.3.190.0050.00317.38
8.3.180.0130.00517.23
8.3.170.0040.00416.48
8.3.160.0100.01016.59
8.3.150.0040.01518.79
8.3.140.0040.00416.55
8.3.130.0100.00718.35
8.3.120.0130.00318.88
8.3.110.0040.00416.75
8.3.100.0040.00424.06
8.3.90.0040.01126.77
8.3.80.0060.00318.43
8.3.70.0100.01616.88
8.3.60.0150.00418.56
8.3.50.0060.00718.55
8.3.40.0040.01118.84
8.3.30.0070.00718.72
8.3.20.0040.00418.96
8.3.10.0000.00823.46
8.3.00.0070.00020.58
8.2.300.0040.00522.14
8.2.290.0130.00620.14
8.2.280.0130.00618.18
8.2.270.0090.00617.08
8.2.260.0150.00017.21
8.2.250.0130.00616.42
8.2.240.0030.00719.05
8.2.230.0030.00620.94
8.2.220.0070.00337.54
8.2.210.0040.00426.77
8.2.200.0030.00616.88
8.2.190.0070.01016.58
8.2.180.0140.00725.92
8.2.170.0040.01122.96
8.2.160.0110.00322.18
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00019.82
8.2.120.0000.00826.35
8.2.110.0090.00020.80
8.2.100.0090.00317.78
8.2.90.0050.00317.91
8.2.80.0050.00317.97
8.2.70.0030.00517.63
8.2.60.0080.00018.05
8.2.50.0000.00818.07
8.2.40.0040.00418.29
8.2.30.0030.00618.15
8.2.20.0040.00418.12
8.2.10.0070.00017.99
8.2.00.0080.00318.07
8.1.340.0140.00717.67
8.1.330.0130.00621.96
8.1.320.0130.00616.22
8.1.310.0080.00016.77
8.1.300.0000.00917.83
8.1.290.0040.00430.84
8.1.280.0200.00025.92
8.1.270.0040.00422.23
8.1.260.0040.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00322.51
8.1.230.0070.00720.85
8.1.220.0040.00417.74
8.1.210.0000.00819.05
8.1.200.0030.00817.13
8.1.190.0040.00417.10
8.1.180.0000.00818.10
8.1.170.0030.00518.82
8.1.160.0040.00418.83
8.1.150.0040.00418.88
8.1.140.0030.00522.14
8.1.130.0030.00320.05
8.1.120.0000.00717.47
8.1.110.0000.00717.44
8.1.100.0080.00017.46
8.1.90.0070.00017.42
8.1.80.0000.00817.39
8.1.70.0000.00717.50
8.1.60.0040.00417.46
8.1.50.0000.00817.48
8.1.40.0040.00417.41
8.1.30.0000.00717.68
8.1.20.0000.00917.48
8.1.10.0030.00517.42
8.1.00.0080.00017.42
8.0.300.0000.00819.98
8.0.290.0040.00416.75
8.0.280.0070.00018.43
8.0.270.0040.00417.13
8.0.260.0030.00318.48
8.0.250.0000.00716.96
8.0.240.0030.00516.99
8.0.230.0030.00316.96
8.0.220.0040.00416.85
8.0.210.0070.00016.80
8.0.200.0000.00716.95
8.0.190.0000.00816.90
8.0.180.0040.00416.86
8.0.170.0000.00816.79
8.0.160.0080.00016.77
8.0.150.0080.00416.84
8.0.140.0000.00816.87
8.0.130.0000.00613.28
8.0.120.0040.00416.74
8.0.110.0000.00716.86
8.0.100.0000.00716.88
8.0.90.0040.00416.77
8.0.80.0090.01016.88
8.0.70.0040.00416.78
8.0.60.0000.00716.93
8.0.50.0000.00716.73
8.0.30.0080.00817.20
8.0.20.0100.01617.40
8.0.10.0000.00717.07
8.0.00.0130.00916.76
7.4.330.0000.00515.55
7.4.320.0060.00016.59
7.4.300.0070.00016.61
7.4.290.0030.00316.40
7.4.280.0000.00716.50
7.4.270.0000.00616.49
7.4.260.0070.00016.38
7.4.250.0040.00416.41
7.4.240.0000.00716.45
7.4.230.0000.00716.33
7.4.220.0040.00416.53
7.4.210.0040.01116.52
7.4.200.0000.00716.39
7.4.160.0100.00916.52
7.4.140.0120.00917.86
7.4.130.0070.01016.61
7.4.120.0090.01016.54
7.4.110.0090.00916.47
7.4.100.0090.01216.41
7.4.90.0120.00916.65
7.4.80.0110.01119.39
7.4.70.0060.00916.45
7.4.60.0060.00916.61
7.4.50.0090.00616.38
7.4.40.0030.01216.63
7.4.00.0080.00814.86
7.3.330.0020.00213.25
7.3.320.0030.00313.05
7.3.310.0060.00316.46
7.3.300.0000.00716.21
7.3.290.0060.00016.30
7.3.280.0070.00716.35
7.3.260.0060.01116.36
7.3.240.0080.00916.48
7.3.230.0130.01016.40
7.3.210.0090.00916.20
7.3.200.0090.00616.15
7.3.190.0180.00416.29
7.3.180.0100.00616.61
7.3.170.0070.01416.23
7.3.160.0040.01216.42
7.3.120.0100.01014.90
7.3.110.0040.01414.75
7.3.100.0090.00314.84
7.3.90.0090.00614.57
7.3.80.0090.00614.92
7.3.70.0040.00415.02
7.3.60.0030.01014.77
7.3.50.0000.01214.49
7.3.40.0080.00314.93
7.3.30.0160.00014.84
7.3.20.0130.00316.78
7.3.10.0040.00916.47
7.3.00.0070.00616.53
7.2.330.0060.01516.68
7.2.320.0130.01016.86
7.2.310.0140.00416.65
7.2.300.0120.00816.41
7.2.290.0120.01116.50
7.2.250.0040.01514.73
7.2.240.0070.01314.77
7.2.230.0080.01115.12
7.2.220.0140.00415.00
7.2.210.0020.01314.69
7.2.200.0140.00315.04
7.2.190.0030.00714.90
7.2.180.0040.01114.88
7.2.170.0080.00515.18
7.2.130.0070.00716.83
7.2.120.0040.00916.77
7.2.110.0140.00716.49
7.2.100.0140.00916.40
7.2.90.0120.00916.37
7.2.80.0100.01016.41
7.2.70.0140.00716.43
7.2.60.0120.00816.59
7.2.50.0150.00516.57
7.2.40.0120.00816.41
7.2.30.0110.00916.56
7.2.20.0130.00816.60
7.2.10.0140.00916.49
7.2.00.0150.00716.55
7.1.330.0040.00416.00
7.1.320.0030.01015.63
7.1.310.0110.00015.88
7.1.300.0000.01415.60
7.1.290.0060.00915.81
7.1.280.0040.00815.75
7.1.270.0070.01015.78
7.1.260.0030.00615.90
7.1.250.0050.00815.73
7.1.230.0590.00713.83
7.1.220.0640.00813.98
7.1.210.0650.00713.98
7.1.200.0460.00713.79
7.1.190.0590.00713.82
7.1.180.1340.00713.82
7.1.170.0430.00913.92
7.1.160.0620.00313.57
7.1.150.0800.01013.66
7.1.140.0800.00713.70
7.1.130.0520.00513.80
7.1.120.0490.00313.88
7.1.110.0580.00713.66
7.1.100.0520.00313.92
7.1.90.0590.01113.86
7.1.80.0610.01313.94
7.1.70.0620.00013.88
7.1.60.0750.00331.88
7.1.50.0920.01131.90
7.1.40.0830.00732.00
7.1.30.0970.00331.76
7.1.20.0900.00331.81
7.1.10.0700.00313.61
7.1.00.0640.00413.81
5.6.380.0030.01014.37

preferences:
47.61 ms | 1622 KiB | 5 Q