3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; $keys = '[a][b][c]'; $value = 'HELLO WORLD'; function setArrayValueFromKeys(&$array, $keys, $value) { $keys = explode('][', trim($keys, '[]')); $reference = &$array; foreach ($keys as $key) { if (!array_key_exists($key, $reference)) { $reference[$key] = []; } $reference = &$reference[$key]; } $reference = $value; } setArrayValueFromKeys($array, $keys, $value); var_dump($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.130.0050.00318.35
8.3.120.0060.00320.70
8.3.110.0090.00020.94
8.3.100.0000.00924.06
8.3.90.0000.00726.77
8.3.80.0030.00716.63
8.3.70.0070.01518.43
8.3.60.0210.00016.50
8.3.50.0130.00821.15
8.3.40.0070.01418.84
8.3.30.0030.01019.21
8.3.20.0020.00520.34
8.3.10.0030.00523.55
8.3.00.0040.00419.18
8.2.250.0050.00316.37
8.2.240.0080.00817.04
8.2.230.0050.00522.58
8.2.220.0080.00037.54
8.2.210.0110.00726.77
8.2.200.0080.00316.75
8.2.190.0070.01416.58
8.2.180.0070.01118.38
8.2.170.0070.00718.84
8.2.160.0130.00622.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00421.13
8.2.110.0050.00520.22
8.2.100.0030.01017.66
8.2.90.0000.00818.03
8.2.80.0000.00818.09
8.2.70.0000.00917.63
8.2.60.0000.00918.16
8.2.50.0040.00418.10
8.2.40.0050.00319.35
8.2.30.0070.00020.69
8.2.20.0000.00817.63
8.2.10.0000.00718.19
8.2.00.0070.00018.12
8.1.300.0030.00619.77
8.1.290.0040.00730.84
8.1.280.0170.00325.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.85
8.1.230.0090.00322.15
8.1.220.0050.00317.79
8.1.210.0040.00419.07
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0050.00817.97
8.1.160.0030.00318.96
8.1.150.0040.00418.79
8.1.140.0000.00817.36
8.1.130.0080.00017.46
8.1.120.0000.00717.44
8.1.110.0030.00517.43
8.1.100.0000.00717.44
8.1.90.0040.00417.46
8.1.80.0050.00217.41
8.1.70.0000.00717.46
8.1.60.0090.00017.48
8.1.50.0030.00617.41
8.1.40.0040.00417.53
8.1.30.0040.00417.65
8.1.20.0090.00617.63
8.1.10.0140.00217.55
8.1.00.0110.00617.47
8.0.300.0040.00419.98
8.0.290.0060.00316.63
8.0.280.0040.00418.45
8.0.270.0030.00316.74
8.0.260.0030.00316.80
8.0.250.0070.00016.92
8.0.240.0040.00416.84
8.0.230.0030.00316.96
8.0.220.0070.00016.80
8.0.210.0000.00816.89
8.0.200.0000.00616.88
8.0.190.0060.00316.91
8.0.180.0000.00716.86
8.0.170.0030.00616.91
8.0.160.0030.00416.84
8.0.150.0110.00416.77
8.0.140.0080.00616.81
8.0.130.0100.00315.07
8.0.120.0100.00416.83
8.0.110.0110.00516.82
8.0.100.0090.00516.74
8.0.90.0090.00616.81
8.0.80.0100.00716.82
8.0.70.0090.00516.81
8.0.60.0020.00816.88
8.0.50.0090.00816.83
8.0.30.0100.00916.89
8.0.20.0100.01017.05
8.0.10.0120.00917.05
8.0.00.0080.01016.87
7.4.330.0080.00116.57
7.4.320.0060.00016.61
7.4.300.0030.00316.51
7.4.290.0030.00316.49
7.4.280.0050.00316.61
7.4.270.0020.00616.56
7.4.260.0100.00416.64
7.4.250.0130.00216.50
7.4.240.0090.00416.45
7.4.230.0080.00016.50
7.4.220.0110.00516.53
7.4.210.0140.00416.57
7.4.200.0080.00616.49
7.4.190.0200.00316.55
7.4.180.0120.00316.50
7.4.160.0080.00716.54
7.4.150.0110.00816.77
7.4.140.0090.00817.00
7.4.130.0070.00916.41
7.4.120.0080.00916.45
7.4.110.0100.00916.49
7.4.100.0150.00816.50
7.4.90.0090.00916.42
7.4.80.0140.00817.08
7.4.70.0150.00616.44
7.4.60.0100.00716.54
7.4.50.0120.00616.46
7.4.40.0130.00716.49
7.4.30.0100.01016.36
7.4.20.0110.00716.53
7.4.10.0130.00616.42
7.4.00.0090.00916.06
7.3.330.0070.00614.79
7.3.320.0090.00314.93
7.3.310.0100.00416.35
7.3.300.0110.00416.24
7.3.290.0100.00516.33
7.3.280.0090.00916.31
7.3.270.0110.00816.60
7.3.260.0110.00816.39
7.3.250.0070.01116.37
7.3.240.0090.00816.31
7.3.230.0090.00916.38
7.3.220.0150.00716.28
7.3.210.0110.00816.29
7.3.200.0120.00816.93
7.3.190.0140.00616.31
7.3.180.0090.01116.42
7.3.170.0150.00716.40
7.3.160.0140.00916.43
7.3.150.0120.01116.27
7.3.140.0120.01016.22
7.3.130.0150.00716.34
7.3.120.0130.00616.05
7.3.110.0130.00716.06
7.3.100.0120.00816.04
7.3.90.0130.00716.26
7.3.80.0100.01116.03
7.3.70.0140.00716.16
7.3.60.0100.00816.15
7.3.50.0130.00515.96
7.3.40.0130.00716.14
7.3.30.0120.00716.14
7.3.20.0140.00616.81
7.3.10.0140.00516.67
7.3.00.0140.00616.70
7.2.340.0200.00816.49
7.2.330.0150.00916.52
7.2.320.0170.01016.48
7.2.310.0120.01316.54
7.2.300.0170.00816.54
7.2.290.0150.01016.55
7.2.280.0170.00816.46
7.2.270.0160.00916.46
7.2.260.0170.00816.52
7.2.250.0150.00916.29
7.2.240.0130.01116.27
7.2.230.0170.00616.27
7.2.220.0170.00616.27
7.2.210.0140.00916.32
7.2.200.0140.00716.40
7.2.190.0160.00916.34
7.2.180.0140.00616.33
7.2.170.0130.00916.39
7.2.160.0140.00916.63
7.2.150.0150.00817.01
7.2.140.0170.00717.05
7.2.130.0130.01217.04
7.2.120.0150.01016.96
7.2.110.0160.00717.02
7.2.100.0150.00816.93
7.2.90.0150.01017.02
7.2.80.0130.00816.95
7.2.70.0140.00817.00
7.2.60.0140.00917.01
7.2.50.0140.00817.07
7.2.40.0130.00917.07
7.2.30.0150.00816.97
7.2.20.0140.01116.96
7.2.10.0130.01016.97
7.2.00.0150.00817.04
7.1.330.0160.00815.96
7.1.320.0250.00616.03
7.1.310.0200.00815.95
7.1.300.0160.00716.00
7.1.290.0240.00515.95
7.1.280.0130.01116.01
7.1.270.0300.00816.00
7.1.260.0170.00616.02
7.1.250.0150.00915.91
7.1.240.0160.00716.01
7.1.230.0170.00716.05
7.1.220.0170.00715.98
7.1.210.0200.00715.99
7.1.200.0220.01015.94
7.1.190.0170.00715.94
7.1.180.0190.00715.90
7.1.170.0180.00715.89
7.1.160.0170.00615.95
7.1.150.0140.00915.96
7.1.140.0180.00715.95
7.1.130.0130.00915.90
7.1.120.0420.00815.90
7.1.110.0220.00815.97
7.1.100.0200.00615.92
7.1.90.0150.00915.89
7.1.80.0180.00915.91
7.1.70.0100.01116.11
7.1.60.0130.00916.55
7.1.50.0140.00916.17
7.1.40.0210.00815.89
7.1.30.0170.00816.02
7.1.20.0160.00715.99
7.1.10.0130.01016.00
7.1.00.0160.01717.07
7.0.330.0190.00515.72
7.0.320.0180.00815.79
7.0.310.0170.00815.80
7.0.300.0150.00615.66
7.0.290.0140.00815.75
7.0.280.0130.00815.67
7.0.270.0140.00915.71
7.0.260.0170.00815.64
7.0.250.0130.00915.74
7.0.240.0150.00815.81
7.0.230.0140.00915.71
7.0.220.0150.00815.83
7.0.210.0140.00815.72
7.0.200.0110.00915.91
7.0.190.0150.00815.76
7.0.180.0150.00915.75
7.0.170.0160.00915.84
7.0.160.0140.00715.69
7.0.150.0120.01015.68
7.0.140.0140.00815.73
7.0.130.0170.00715.81
7.0.120.0120.00915.78
7.0.110.0140.00615.71
7.0.100.0120.01015.69
7.0.90.0150.00615.75
7.0.80.0140.00915.79
7.0.70.0150.00715.67
7.0.60.0130.02016.44
7.0.50.0140.02216.08
7.0.40.0170.01916.07
7.0.30.0240.02116.09
7.0.20.0220.01516.10
7.0.10.0150.02016.21
7.0.00.0130.01516.14
5.6.400.0140.01115.89
5.6.390.0150.00915.91
5.6.380.0100.01416.05
5.6.370.0130.00815.83
5.6.360.0140.00815.82
5.6.350.0150.00715.83
5.6.340.0150.00615.75
5.6.330.0160.00715.82
5.6.320.0120.00915.89
5.6.310.0110.00915.84
5.6.300.0170.00815.87
5.6.290.0170.00715.85
5.6.280.0100.02116.78
5.6.270.0160.00715.85
5.6.260.0140.00915.96
5.6.250.0180.00615.89
5.6.240.0150.00916.07
5.6.230.0110.01316.01
5.6.220.0130.01015.97
5.6.210.0150.01916.74
5.6.200.0120.02016.39
5.6.190.0130.01416.78
5.6.180.0180.01916.75
5.6.170.0180.01316.79
5.6.160.0150.01316.70
5.6.150.0150.02216.40
5.6.140.0130.01716.33
5.6.130.0110.01516.35
5.6.120.0130.01316.85
5.6.110.0130.01616.73
5.6.100.0120.01416.79
5.6.90.0120.01516.87
5.6.80.0150.01816.52
5.6.70.0140.01015.91
5.6.60.0150.00815.88
5.6.50.0150.00915.78
5.6.40.0130.01016.00
5.6.30.0140.00815.88
5.6.20.0150.00915.89
5.6.10.0130.01116.02
5.6.00.0150.01015.88
5.5.380.0140.01016.02
5.5.370.0150.01015.96
5.5.360.0160.00815.91
5.5.350.0820.01216.62
5.5.340.0170.01616.29
5.5.330.0130.02216.65
5.5.320.0120.02116.62
5.5.310.0160.02016.61
5.5.300.0150.01516.34
5.5.290.0150.01216.30
5.5.280.0140.01416.76
5.5.270.0180.02016.72
5.5.260.0130.02116.76
5.5.250.0140.01716.70
5.5.240.0160.02116.69
5.5.230.0100.01215.87
5.5.220.0140.00915.88
5.5.210.0150.00915.89
5.5.200.0130.00915.86
5.5.190.0160.00815.84
5.5.180.0140.00915.83
5.5.170.0160.00815.85
5.5.160.0160.00715.85
5.5.150.0140.01015.83
5.5.140.0120.01215.77
5.5.130.0150.00915.87
5.5.120.0170.00715.86
5.5.110.0130.01015.74
5.5.100.0140.00815.92
5.5.90.0130.00916.04
5.5.80.0150.01115.99
5.5.70.0130.00915.94
5.5.60.0130.01015.91
5.5.50.0150.00915.91
5.5.40.0150.00815.89
5.5.30.0140.00915.86
5.5.20.0150.00715.93
5.5.10.0170.00515.87
5.5.00.0140.00915.81
5.4.450.0150.01314.44
5.4.440.0130.01314.33
5.4.430.0140.01814.41
5.4.420.0150.01214.45
5.4.410.0150.01714.42
5.4.400.0110.01314.41
5.4.390.0130.01914.34
5.4.380.0150.01514.35
5.4.370.0150.01014.47
5.4.360.0130.01714.38
5.4.350.0130.01514.29
5.4.340.0130.01914.30
5.4.330.0140.00613.43
5.4.320.0130.01814.37
5.4.310.0150.01114.42
5.4.300.0130.01714.36
5.4.290.0110.01914.33
5.4.280.0150.01614.39
5.4.270.0170.01314.24
5.4.260.0140.01014.40
5.4.250.0170.01614.38
5.4.240.0140.01214.34
5.4.230.0130.01514.19
5.4.220.0170.01614.24
5.4.210.0140.01514.34
5.4.200.0140.01114.24
5.4.190.0120.00914.29
5.4.180.0150.01114.25
5.4.170.0150.01114.18
5.4.160.0140.01714.29
5.4.150.0120.01714.21
5.4.140.0170.01413.93
5.4.130.0130.01113.95
5.4.120.0130.01013.91
5.4.110.0110.01313.88
5.4.100.0120.01213.91
5.4.90.0130.01213.98
5.4.80.0130.01013.96
5.4.70.0130.01013.95
5.4.60.0110.01113.93
5.4.50.0110.01213.91
5.4.40.0140.01013.95
5.4.30.0110.01114.01
5.4.20.0130.01113.97
5.4.10.0150.00813.92
5.4.00.0110.01313.75
5.3.100.0090.00212.76

preferences:
64.83 ms | 403 KiB | 5 Q