3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arg1 = "['1']"; $arg2 = "['2']"; $arg3 = "['3']"; $_SESSION['1']['2']['3'] = 'zzzz'; function setKey($session_keys, $val) { $current_key = ''; $counter = 0; $prev_step = &$_SESSION; $tmp = &$prev_step; $session_keys_array = explode(':', $session_keys); foreach ($session_keys_array as $key) { if (is_array($tmp[$key])) { $tmp = &$tmp[$key]; var_dump($tmp); } else { $tmp = $val; var_dump($tmp); } } } setKey('1:2:3',5); // var_dump($_SESSION);

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.80.0030.00618.55
8.3.70.0120.00618.39
8.3.60.0120.00916.75
8.3.50.0140.00521.16
8.3.40.0060.00918.85
8.3.30.0040.01118.58
8.3.20.0000.00720.16
8.3.10.0040.00421.89
8.3.00.0080.00021.95
8.2.200.0030.00616.50
8.2.190.0150.00616.58
8.2.180.0070.01416.75
8.2.170.0070.01122.96
8.2.160.0060.00920.28
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0050.00321.06
8.2.120.0040.00426.35
8.2.110.0090.00020.56
8.2.100.0120.00017.93
8.2.90.0080.00019.31
8.2.80.0000.00817.97
8.2.70.0100.00017.38
8.2.60.0030.00617.93
8.2.50.0060.00318.09
8.2.40.0080.00022.18
8.2.30.0000.00719.41
8.2.20.0000.00717.63
8.2.10.0000.00718.19
8.2.00.0090.00018.23
8.1.290.0030.00630.84
8.1.280.0090.00625.92
8.1.270.0140.00022.02
8.1.260.0070.00028.09
8.1.250.0050.00328.09
8.1.240.0030.00620.89
8.1.230.0090.00317.64
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0040.00417.23
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0030.00618.60
8.1.160.0040.00420.77
8.1.150.0070.00019.06
8.1.140.0000.00717.36
8.1.130.0000.00717.52
8.1.120.0000.00717.48
8.1.110.0000.00717.41
8.1.100.0000.00717.48
8.1.90.0000.00717.37
8.1.80.0000.00717.50
8.1.70.0050.00217.50
8.1.60.0030.00617.59
8.1.50.0030.00517.53
8.1.40.0000.00817.52
8.1.30.0000.00817.60
8.1.20.0080.00017.69
8.1.10.0040.00417.56
8.1.00.0040.00417.36
8.0.300.0050.00318.77
8.0.290.0040.00416.75
8.0.280.0000.00718.35
8.0.270.0000.00716.78
8.0.260.0030.00317.17
8.0.250.0040.00416.97
8.0.240.0090.00016.95
8.0.230.0040.00417.01
8.0.220.0030.00316.89
8.0.210.0050.00216.92
8.0.200.0030.00316.94
8.0.190.0040.00416.94
8.0.180.0000.00716.96
8.0.170.0060.00316.81
8.0.160.0050.00316.87
8.0.150.0000.00716.88
8.0.140.0040.00416.93
8.0.130.0050.00013.40
8.0.120.0060.00316.89
8.0.110.0050.00216.88
8.0.100.0000.00716.73
8.0.90.0040.00416.92
8.0.80.0130.00316.80
8.0.70.0030.00516.90
8.0.60.0070.00016.77
8.0.50.0000.00716.83
8.0.30.0090.01017.16
8.0.20.0120.00917.40
8.0.10.0000.00716.90
8.0.00.0120.00716.79
7.4.330.0000.00516.82
7.4.320.0060.00016.43
7.4.300.0000.00816.41
7.4.290.0080.00016.52
7.4.280.0080.00016.51
7.4.270.0040.00416.43
7.4.260.0000.00716.51
7.4.250.0040.00416.57
7.4.240.0000.00716.59
7.4.230.0000.00716.30
7.4.220.0060.01216.68
7.4.210.0090.00616.55
7.4.200.0030.00316.40
7.4.160.0080.00816.53
7.4.150.0140.00417.40
7.4.140.0100.01017.86
7.4.130.0100.00816.48
7.4.120.0050.01316.36
7.4.110.0160.01016.53
7.4.100.0170.00316.52
7.4.90.0150.00716.62
7.4.80.0120.00619.39
7.4.70.0130.01016.56
7.4.60.0120.00416.51
7.4.50.0070.00716.38
7.4.40.0090.00916.25
7.4.30.0150.00316.31
7.4.00.0070.00714.90
7.3.330.0040.00313.16
7.3.320.0030.00313.39
7.3.310.0070.00016.39
7.3.300.0030.00316.41
7.3.290.0070.00916.39
7.3.280.0090.01016.31
7.3.270.0060.01117.40
7.3.260.0060.01616.45
7.3.250.0110.00716.42
7.3.240.0070.01016.47
7.3.230.0090.00916.57
7.3.210.0130.00316.39
7.3.200.0170.01019.39
7.3.190.0080.01116.40
7.3.180.0030.01416.42
7.3.170.0070.01016.56
7.3.160.0070.01016.51
7.3.120.0060.01314.86
7.3.110.0100.00315.04
7.3.100.0000.00814.93
7.3.90.0120.00314.93
7.3.80.0000.01515.23
7.3.70.0040.00714.73
7.3.60.0090.00314.89
7.3.50.0040.01114.81
7.3.40.0060.01014.87
7.3.30.0030.01314.95
7.3.20.0080.00416.79
7.3.10.0070.00716.75
7.3.00.0130.00316.66
7.2.330.0150.00616.52
7.2.320.0150.00616.82
7.2.310.0110.01116.73
7.2.300.0070.01016.59
7.2.290.0090.01416.45
7.2.240.0100.00715.13
7.2.230.0100.00715.14
7.2.220.0060.01215.23
7.2.210.0070.00714.95
7.2.200.0060.00815.13
7.2.190.0060.01015.15
7.2.180.0050.00515.11
7.2.170.0030.01015.08
7.2.160.0070.00715.05
7.2.150.0030.01416.89
7.2.140.0070.00716.83
7.2.130.0090.00616.86
7.2.120.0100.00316.86
7.2.110.0100.00317.13
7.2.100.0060.00617.02
7.2.90.0030.01016.96
7.2.80.0100.00317.06
7.2.70.0050.00516.93
7.2.60.0060.00316.86
7.2.50.0070.01016.98
7.2.40.0030.01016.77
7.2.30.0040.00717.03
7.2.20.0070.00716.77
7.2.10.0030.01317.08
7.2.00.0060.00617.12
7.1.330.0060.01215.63
7.1.320.0030.01015.88
7.1.310.0030.00915.93
7.1.300.0040.00415.67
7.1.290.0030.00615.96
7.1.280.0000.01115.88
7.1.270.0000.01415.84
7.1.260.0070.00315.86
7.1.250.0100.00715.54
7.1.70.0050.00217.38
7.1.60.0040.02219.40
7.1.50.0040.01816.95
7.1.00.0030.07722.33
7.0.200.0560.00714.79
7.0.60.0200.07721.81
7.0.50.0000.05017.89
7.0.40.0000.08720.21
7.0.30.0200.05320.09
7.0.20.0330.04320.23
7.0.10.0070.05320.20
7.0.00.0330.06020.20
5.6.280.0070.04721.07
5.6.210.0100.04020.61
5.6.200.0070.03718.27
5.6.190.0100.05320.54
5.6.180.0300.08320.33
5.6.170.0130.05020.45
5.6.160.0070.04720.46
5.6.150.0070.04018.18
5.6.140.0000.06018.12
5.6.130.0130.06718.14
5.6.120.0100.06721.04
5.6.110.0070.04321.12
5.6.100.0130.07020.98
5.6.90.0030.06720.99
5.6.80.0000.08320.49
5.5.350.0030.07020.38
5.5.340.0070.06017.98
5.5.330.0030.05720.13
5.5.320.0470.06320.38
5.5.310.0270.08020.37
5.5.300.0070.03718.06
5.5.290.0030.06017.92
5.5.280.0000.04720.86
5.5.270.0000.09020.96
5.5.260.0070.05720.76
5.5.250.0130.07720.57
5.5.240.0070.08320.16

preferences:
57.55 ms | 401 KiB | 5 Q