3v4l.org

run code in 300+ PHP versions simultaneously
<?php class t { private static $configs = ["a" => ["b" => "c"]]; public static function set($name, $value) { $keyParts = explode(".", $name); $config =& self::$configs; while (!empty($keyParts)) { $key = array_shift($keyParts); if (!isset($config[$key])) { $config[$key] = []; } if (empty($keyParts)) { $config[$key] = $value; return; } $config =& $config[$key]; //unset($config); //$config = $tconfig; } } private static function getKey($parts, $config = null) { if (is_null($config)) { $config =& self::$configs; } return self::findKey($parts, $config, true); } private static function findKey($keyParts, &$array, $returnValue = false) { $key = array_shift($keyParts); if (!isset($array[$key])) { return false; } if (empty($keyParts)) { if ($returnValue) { return $array[$key]; } return true; } return self::findKey($keyParts, $array[$key], $returnValue); } public static function dump() { var_dump(self::$configs); } } t::set("a.b", "vittu"); t::set("c", "perse"); t::dump();

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.70.0040.01616.50
8.3.60.0200.00018.39
8.3.50.0120.00921.91
8.3.40.0120.00919.02
8.3.30.0120.00319.04
8.3.20.0070.00020.39
8.3.10.0040.00423.61
8.3.00.0070.00018.76
8.2.190.0120.00318.41
8.2.180.0090.00618.29
8.2.170.0090.00922.96
8.2.160.0130.00722.25
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0080.00020.94
8.2.110.0100.00020.47
8.2.100.0090.00317.69
8.2.90.0040.00417.75
8.2.80.0040.00418.89
8.2.70.0000.00917.80
8.2.60.0000.01018.09
8.2.50.0050.00319.23
8.2.40.0030.00619.30
8.2.30.0000.00719.23
8.2.20.0050.00217.66
8.2.10.0000.00818.13
8.2.00.0040.00417.73
8.1.280.0120.00325.92
8.1.270.0050.00318.72
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00623.83
8.1.230.0030.00920.86
8.1.220.0080.00017.88
8.1.210.0040.00418.77
8.1.200.0050.00517.38
8.1.190.0030.00517.23
8.1.180.0060.00318.97
8.1.170.0000.00818.59
8.1.160.0050.00318.89
8.1.150.0040.00418.95
8.1.140.0000.00717.40
8.1.130.0000.00717.87
8.1.120.0000.00717.35
8.1.110.0040.00417.49
8.1.100.0040.00417.43
8.1.90.0040.00417.45
8.1.80.0090.00017.53
8.1.70.0040.00417.41
8.1.60.0000.00817.47
8.1.50.0030.00517.41
8.1.40.0080.00017.40
8.1.30.0040.00417.48
8.1.20.0000.00717.58
8.1.10.0050.00217.49
8.1.00.0030.00617.37
8.0.300.0000.01018.77
8.0.290.0090.00016.75
8.0.280.0000.00718.46
8.0.270.0070.00017.26
8.0.260.0030.00317.27
8.0.250.0030.00316.93
8.0.240.0040.00416.95
8.0.230.0040.00416.98
8.0.220.0080.00016.83
8.0.210.0050.00216.79
8.0.200.0030.00316.87
8.0.190.0050.00316.97
8.0.180.0030.00616.92
8.0.170.0040.00416.88
8.0.160.0030.00316.92
8.0.150.0000.00916.84
8.0.140.0080.00016.78
8.0.130.0000.00513.31
8.0.120.0000.00716.91
8.0.110.0030.00616.92
8.0.100.0050.00216.80
8.0.90.0000.00816.73
8.0.80.0100.00716.95
8.0.70.0020.00516.78
8.0.60.0080.00016.80
8.0.50.0040.00416.88
8.0.30.0090.01517.25
8.0.20.0040.01617.40
8.0.10.0040.00416.85
8.0.00.0160.00416.89
7.4.330.0000.00515.03
7.4.320.0060.00016.56
7.4.300.0070.00016.61
7.4.290.0080.00016.38
7.4.280.0000.00716.52
7.4.270.0030.00616.57
7.4.260.0030.00316.58
7.4.250.0040.00416.56
7.4.240.0060.00116.43
7.4.230.0070.00016.50
7.4.220.0100.00716.63
7.4.210.0080.00916.64
7.4.200.0000.00716.60
7.4.160.0090.00616.48
7.4.150.0120.01217.40
7.4.140.0000.01917.86
7.4.130.0100.01216.65
7.4.120.0110.00716.57
7.4.110.0200.00316.55
7.4.100.0140.00316.52
7.4.90.0060.01216.53
7.4.80.0120.00619.39
7.4.70.0110.00616.63
7.4.60.0060.01216.38
7.4.50.0030.00616.16
7.4.40.0100.00616.55
7.4.30.0150.00616.50
7.4.00.0060.00915.10
7.3.330.0000.00513.36
7.3.320.0050.00013.25
7.3.310.0060.00316.28
7.3.300.0030.00316.33
7.3.290.0060.01016.33
7.3.280.0090.01016.38
7.3.270.0100.00717.40
7.3.260.0130.01016.61
7.3.250.0100.00916.52
7.3.240.0080.00916.38
7.3.230.0030.01416.43
7.3.210.0110.00816.47
7.3.200.0030.01319.39
7.3.190.0100.00716.45
7.3.180.0080.00816.63
7.3.170.0180.00316.51
7.3.160.0060.01116.55
7.3.120.0170.00314.75
7.3.110.0070.01314.96
7.3.100.0110.00414.91
7.3.90.0120.00314.93
7.3.80.0070.00315.04
7.3.70.0040.01215.05
7.3.60.0100.00315.07
7.3.50.0100.00714.75
7.3.40.0040.01114.98
7.3.30.0120.00614.78
7.3.20.0060.00316.80
7.3.10.0110.00316.72
7.3.00.0040.01216.58
7.2.330.0090.01016.90
7.2.320.0190.00016.95
7.2.310.0150.00616.89
7.2.300.0120.00616.92
7.2.290.0100.00616.52
7.2.250.0080.00814.91
7.2.240.0160.00314.86
7.2.230.0060.01214.70
7.2.220.0090.00315.38
7.2.210.0030.01215.20
7.2.200.0040.01115.21
7.2.190.0030.01015.03
7.2.180.0030.01615.11
7.2.170.0030.01714.98
7.2.60.0000.01216.70
7.2.00.0110.00619.14
7.1.330.0030.01015.81
7.1.320.0060.00915.74
7.1.310.0030.01015.88
7.1.300.0060.00615.61
7.1.290.0040.01415.92
7.1.280.0100.01015.76
7.1.270.0140.00315.69
7.1.260.0060.00915.89
7.1.200.0070.00315.77
7.1.100.0580.00615.96
7.1.70.0050.00317.03
7.1.60.0100.01319.22
7.1.50.0030.00717.08
7.1.00.0000.08022.29
7.0.200.0000.00716.90
7.0.140.0070.05722.04
7.0.60.0100.08019.97
7.0.50.0000.05017.92
7.0.40.0030.04320.27
7.0.30.0230.04720.17
7.0.20.0370.04020.34
7.0.10.0100.07320.15
7.0.00.0070.08020.23
5.6.280.0000.07721.13
5.6.210.0130.07320.70
5.6.200.0100.08018.25
5.6.190.0130.06720.64
5.6.180.0230.05720.48
5.6.170.0330.05720.53
5.6.160.0030.04320.47
5.6.150.0030.09018.15
5.6.140.0070.03718.12
5.6.130.0100.03318.14
5.6.120.0100.08320.99
5.6.110.0100.08320.99
5.6.100.0030.08721.01
5.6.90.0130.05321.11
5.6.80.0070.08320.52
5.5.350.0230.08320.50
5.5.340.0100.07318.12
5.5.330.0030.06320.13
5.5.320.0330.04720.30
5.5.310.0300.05020.34
5.5.300.0070.07718.03
5.5.290.0100.06017.98
5.5.280.0070.03720.88
5.5.270.0000.04720.77
5.5.260.0130.07320.80
5.5.250.0100.05020.63
5.5.240.0070.07320.04
5.4.450.0570.06719.61
5.4.440.0630.06319.43
5.4.430.1200.06319.23
5.4.420.0500.05719.47
5.4.410.0570.05319.40
5.4.400.0630.05719.28
5.4.390.0770.05318.89
5.4.380.0970.03318.78
5.4.370.0630.06718.69
5.4.360.0700.05718.72
5.4.350.0670.06318.53
5.4.340.0730.05318.59
5.4.320.0730.05718.78
5.4.310.0730.05718.83
5.4.300.0830.05018.77
5.4.290.0700.05318.59
5.4.280.0770.05018.69
5.4.270.0700.05318.60
5.4.260.0800.04718.77
5.4.250.0770.05318.53
5.4.240.0730.05318.69
5.4.230.0730.05718.49
5.4.220.1030.07318.73
5.4.210.0800.06018.74
5.4.200.0870.05016.79
5.4.190.0770.05018.76
5.4.180.0770.05018.48
5.4.170.0770.05318.55
5.4.160.0800.04718.71
5.4.150.0770.05718.71
5.4.140.0670.05716.46
5.4.130.0700.05716.32
5.4.120.0700.05716.21
5.4.110.0830.04716.45
5.4.100.0800.04716.18
5.4.90.0730.05016.22
5.4.80.0230.04316.28
5.4.70.0200.04316.28
5.4.60.0230.03716.18
5.4.50.0200.04316.24
5.4.40.0130.05016.16
5.4.30.0130.05016.40
5.4.20.0200.04716.21
5.4.10.0200.04316.40
5.4.00.0130.04715.75
5.3.290.0200.04714.79
5.3.280.0270.04014.69
5.3.270.0130.05714.77
5.3.260.0200.05014.66
5.3.250.0130.05314.70
5.3.240.0130.05014.64
5.3.230.0170.05014.78
5.3.220.0230.04314.61
5.3.210.0070.06314.73
5.3.200.0170.05014.59
5.3.190.0200.04714.61
5.3.180.0100.05314.78
5.3.170.0100.05314.66
5.3.160.0170.04714.73
5.3.150.0100.05314.59
5.3.140.0100.05014.55
5.3.130.0200.04314.65
5.3.120.0030.06314.55
5.3.110.0330.04314.65
5.3.100.0200.05014.09
5.3.90.0100.05314.01
5.3.80.0170.06714.22
5.3.70.0130.07014.23
5.3.60.0130.05013.98
5.3.50.0200.06313.99
5.3.40.0170.04313.93
5.3.30.0070.05314.01
5.3.20.0130.04713.66
5.3.10.0170.04313.75
5.3.00.0070.06013.69
5.2.170.0130.04311.18
5.2.160.0200.04311.15
5.2.150.0200.04311.34
5.2.140.0100.04311.25
5.2.130.0130.04011.30
5.2.120.0070.04711.14
5.2.110.0100.04011.31
5.2.100.0100.03711.10
5.2.90.0100.04711.30
5.2.80.0170.04311.21
5.2.70.0170.03711.11
5.2.60.0070.04711.09
5.2.50.0100.04311.05
5.2.40.0030.04311.03
5.2.30.0070.04311.18
5.2.20.0070.04311.00
5.2.10.0170.03310.84
5.2.00.0030.04310.81
5.1.60.0070.03710.06
5.1.50.0130.0339.99
5.1.40.0100.03710.01
5.1.30.0270.05710.38
5.1.20.0030.04010.48
5.1.10.0170.04010.16
5.1.00.0070.03710.10
5.0.50.0070.0278.65
5.0.40.0030.0378.52
5.0.30.0030.0478.21
5.0.20.0030.0278.32
5.0.10.0070.0278.16
5.0.00.0000.0478.19
4.4.90.0030.0235.88
4.4.80.0070.0205.87
4.4.70.0070.0205.86
4.4.60.0000.0275.96
4.4.50.0030.0235.96
4.4.40.0070.0335.90
4.4.30.0070.0205.91
4.4.20.0070.0205.94
4.4.10.0030.0235.94
4.4.00.0070.0336.00
4.3.110.0100.0175.86
4.3.100.0070.0175.89
4.3.90.0030.0235.81
4.3.80.0030.0335.89
4.3.70.0030.0235.87
4.3.60.0070.0175.81
4.3.50.0030.0205.86
4.3.40.0030.0335.73
4.3.30.0000.0234.66
4.3.20.0030.0234.66
4.3.10.0030.0204.66
4.3.00.0100.0277.30

preferences:
58.5 ms | 401 KiB | 5 Q