3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ["test1", "test2"]; $tree = array( 10 => array(), 11 => array( 4 => array(), 5 => array(), 6 => array() ) ); $path = array(11,5); function setByIndices(&$tree, $path, $data, $indices = []) { foreach ($tree as $k => &$v) { $indices[] = $k; if ($indices === $path) { $v = $data; return; } if (is_array($v)) setByIndices($v, $path, $data, $indices); array_pop($indices); } } setByIndices($tree, $path, $data); print_r($tree);

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.120.0090.00720.35
8.4.110.0110.00922.69
8.4.100.0090.01118.75
8.4.90.0100.00918.79
8.4.80.0050.00320.71
8.4.70.0040.00717.79
8.4.60.0120.00818.82
8.4.50.0140.00718.71
8.4.40.0100.01019.46
8.4.30.0090.01322.25
8.4.20.0070.01320.66
8.4.10.0000.00919.27
8.3.250.0080.00719.03
8.3.240.0080.01116.69
8.3.230.0120.00716.75
8.3.220.0100.00818.83
8.3.210.0090.00818.67
8.3.200.0030.00516.54
8.3.190.0050.00417.13
8.3.180.0110.00817.28
8.3.170.0060.01220.90
8.3.160.0120.00617.02
8.3.150.0060.00317.26
8.3.140.0080.00018.35
8.3.130.0090.00016.61
8.3.120.0060.00320.65
8.3.110.0040.00416.79
8.3.100.0040.00418.53
8.3.90.0070.00018.54
8.3.80.0140.00018.43
8.3.70.0100.01016.75
8.3.60.0140.00718.30
8.3.50.0070.01217.21
8.3.40.0040.01118.71
8.3.30.0090.00618.55
8.3.20.0040.00421.85
8.3.10.0040.00421.91
8.3.00.0080.00023.48
8.2.290.0130.00620.34
8.2.280.0090.00318.40
8.2.270.0090.00917.06
8.2.260.0100.00716.57
8.2.250.0040.00416.69
8.2.240.0160.00318.73
8.2.230.0070.00420.94
8.2.220.0000.00924.06
8.2.210.0050.00326.77
8.2.200.0090.00016.38
8.2.190.0070.00718.17
8.2.180.0070.00718.30
8.2.170.0170.00322.96
8.2.160.0100.00320.43
8.2.150.0000.00924.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0070.00019.41
8.2.110.0030.00619.21
8.2.100.0000.01118.03
8.2.90.0040.00718.03
8.2.80.0000.00918.03
8.2.70.0040.00417.93
8.2.60.0040.00417.97
8.2.50.0040.00418.10
8.2.40.0040.00420.47
8.2.30.0000.00719.36
8.2.20.0000.00718.12
8.2.10.0040.00419.19
8.2.00.0070.00019.35
8.1.330.0120.00621.89
8.1.320.0080.01116.09
8.1.310.0110.00718.41
8.1.300.0000.00918.66
8.1.290.0040.00818.88
8.1.280.0120.00625.92
8.1.270.0060.00323.97
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0000.01023.92
8.1.230.0100.00322.69
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.36
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00418.56
8.1.160.0070.00318.93
8.1.150.0070.00018.81
8.1.140.0040.00418.84
8.1.130.0030.00320.09
8.1.120.0040.00417.47
8.1.110.0040.00417.46
8.1.100.0050.00317.45
8.1.90.0000.00717.44
8.1.80.0050.00317.50
8.1.70.0040.00417.51
8.1.60.0000.00817.52
8.1.50.0040.00417.54
8.1.40.0000.00917.49
8.1.30.0080.00017.48
8.1.20.0000.00917.62
8.1.10.0090.00017.54
8.1.00.0000.00717.37
8.0.300.0030.00619.64
8.0.290.0000.00716.75
8.0.280.0070.00018.31
8.0.270.0070.00017.16
8.0.260.0060.00018.45
8.0.250.0000.00716.95
8.0.240.0070.00016.92
8.0.230.0040.00416.99
8.0.220.0040.00416.76
8.0.210.0000.00716.80
8.0.200.0050.00216.86
8.0.190.0070.00016.96
8.0.180.0070.00016.81
8.0.170.0000.00916.94
8.0.160.0000.00716.91
8.0.150.0000.00716.84
8.0.140.0030.00616.86
8.0.130.0030.00313.27
8.0.120.0000.00716.78
8.0.110.0000.00716.71
8.0.100.0040.00416.95
8.0.90.0040.00416.76
8.0.80.0060.01316.84
8.0.70.0040.00416.87
8.0.60.0040.00416.92
8.0.50.0030.00516.75
8.0.30.0120.00616.99
8.0.20.0030.01616.98
8.0.10.0040.00417.02
8.0.00.0130.00716.91
7.4.330.0000.00515.55
7.4.320.0070.00016.57
7.4.300.0050.00216.63
7.4.290.0000.00716.50
7.4.280.0060.00316.59
7.4.270.0060.00316.65
7.4.260.0030.00316.51
7.4.250.0030.00316.39
7.4.240.0030.00516.50
7.4.230.0000.00816.34
7.4.220.0000.00716.66
7.4.210.0040.00916.62
7.4.200.0030.00616.55
7.4.160.0090.01016.58
7.4.140.0070.01017.86
7.4.130.0160.00316.51
7.4.120.0070.01016.49
7.4.110.0030.01316.61
7.4.100.0130.01016.51
7.4.90.0060.01216.45
7.4.80.0060.01019.39
7.4.70.0070.01116.64
7.4.60.0030.01416.46
7.4.50.0050.00916.54
7.4.40.0060.01216.61
7.4.00.0100.00514.88
7.3.330.0030.00513.39
7.3.320.0030.00313.23
7.3.310.0070.00016.43
7.3.300.0020.00516.32
7.3.290.0080.00816.38
7.3.280.0110.00516.36
7.3.260.0120.00716.48
7.3.240.0140.00316.48
7.3.230.0070.01016.32
7.3.210.0100.00616.46
7.3.200.0080.00816.23
7.3.190.0060.01016.39
7.3.180.0090.00616.55
7.3.170.0170.00016.42
7.3.160.0100.00616.52
7.3.120.0060.01214.64
7.3.110.0070.01014.86
7.3.100.0120.00014.52
7.3.90.0070.00714.77
7.3.80.0070.00714.75
7.3.70.0000.01414.83
7.3.60.0060.01114.76
7.3.50.0100.00714.81
7.3.40.0090.00614.75
7.3.30.0100.00614.71
7.3.20.0140.00515.45
7.3.10.0100.00415.44
7.3.00.0100.00615.38
7.2.330.0060.01216.83
7.2.320.0100.00716.71
7.2.310.0070.01116.77
7.2.300.0140.00416.39
7.2.290.0110.00716.51
7.2.250.0090.00914.84
7.2.240.0170.00315.03
7.2.230.0100.00715.17
7.2.220.0000.01414.95
7.2.210.0060.00915.29
7.2.200.0030.00715.07
7.2.190.0080.00914.95
7.2.180.0070.00714.94
7.2.170.0070.00614.99
7.2.160.0080.00815.06
7.2.150.0170.01014.92
7.2.140.0230.00314.91
7.2.130.0150.00414.91
7.2.120.0090.00914.87
7.2.110.0170.00314.96
7.2.100.0130.00815.09
7.2.90.0140.01015.03
7.2.80.0100.00815.03
7.2.70.0160.00515.11
7.2.60.0150.01214.95
7.2.50.0130.00614.93
7.2.40.0170.00715.06
7.2.30.0100.00814.99
7.2.20.0130.00615.04
7.2.10.0110.00815.13
7.2.00.0060.00815.04
7.1.330.0140.00015.73
7.1.320.0060.00615.66
7.1.310.0070.00715.84
7.1.300.0130.00614.65
7.1.290.0110.00614.55
7.1.280.0090.00814.48
7.1.270.0220.00514.70
7.1.260.0100.00514.52
7.1.250.0090.00513.84

preferences:
133.12 ms | 403 KiB | 5 Q