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::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.60.0100.01018.30
8.3.50.0100.01018.18
8.3.40.0120.00318.87
8.3.30.0100.00719.21
8.3.20.0040.00420.29
8.3.10.0040.00423.30
8.3.00.0040.00419.13
8.2.180.0080.00818.41
8.2.170.0030.01022.96
8.2.160.0070.01422.13
8.2.150.0070.00724.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00321.04
8.2.110.0000.00822.25
8.2.100.0110.00017.91
8.2.90.0000.00817.75
8.2.80.0030.00518.77
8.2.70.0000.00817.93
8.2.60.0000.00818.09
8.2.50.0040.00418.10
8.2.40.0000.00719.47
8.2.30.0050.00219.26
8.2.20.0000.00817.75
8.2.10.0000.00818.05
8.2.00.0040.00417.66
8.1.280.0080.00825.92
8.1.270.0080.00019.00
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.75
8.1.230.0000.01220.74
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0040.00417.38
8.1.190.0090.00017.35
8.1.180.0040.00418.96
8.1.170.0080.00018.39
8.1.160.0000.00718.91
8.1.150.0040.00418.89
8.1.140.0020.00517.50
8.1.130.0070.00017.73
8.1.120.0040.00417.47
8.1.110.0050.00317.32
8.1.100.0000.00717.45
8.1.90.0000.00817.35
8.1.80.0040.00417.50
8.1.70.0000.00717.48
8.1.60.0040.00417.55
8.1.50.0000.00817.41
8.1.40.0040.00417.42
8.1.30.0040.00417.60
8.1.20.0050.00317.55
8.1.10.0030.00617.49
8.1.00.0040.00417.40
8.0.300.0080.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00518.50
8.0.270.0030.00317.27
8.0.260.0060.00017.27
8.0.250.0000.00717.00
8.0.240.0030.00316.83
8.0.230.0030.00317.02
8.0.220.0060.00016.93
8.0.210.0030.00316.92
8.0.200.0000.00717.00
8.0.190.0000.00817.00
8.0.180.0050.00216.95
8.0.170.0030.00516.89
8.0.160.0040.00416.96
8.0.150.0090.00016.90
8.0.140.0000.00816.81
8.0.130.0050.00013.37
8.0.120.0030.00516.86
8.0.110.0040.00416.89
8.0.100.0040.00416.88
8.0.90.0000.00716.77
8.0.80.0030.01316.90
8.0.70.0040.00416.96
8.0.60.0070.00016.91
8.0.50.0000.00716.74
8.0.30.0160.00716.96
8.0.20.0110.01017.43
8.0.10.0040.00417.06
8.0.00.0100.00716.67
7.4.330.0050.00015.14
7.4.320.0030.00316.43
7.4.300.0000.00616.52
7.4.290.0000.00816.65
7.4.280.0000.00816.36
7.4.270.0070.00016.56
7.4.260.0030.00716.62
7.4.250.0000.00816.55
7.4.240.0020.00516.54
7.4.230.0070.00016.26
7.4.220.0090.00916.47
7.4.210.0000.02116.46
7.4.200.0030.00316.72
7.4.160.0090.00616.27
7.4.150.0110.01117.40
7.4.140.0150.00517.86
7.4.130.0080.01316.59
7.4.120.0120.00616.48
7.4.110.0150.00616.53
7.4.100.0000.01916.63
7.4.90.0170.00016.49
7.4.80.0100.01619.39
7.4.70.0070.01016.53
7.4.60.0030.01316.34
7.4.50.0000.00616.64
7.4.40.0110.00616.54
7.4.30.0120.00916.36
7.4.00.0040.01415.03
7.3.330.0000.00613.24
7.3.320.0000.00513.20
7.3.310.0030.00316.20
7.3.300.0030.00316.26
7.3.290.0090.00516.31
7.3.280.0080.01116.35
7.3.270.0000.01717.40
7.3.260.0090.00916.56
7.3.250.0070.01116.60
7.3.240.0120.00616.39
7.3.230.0200.00016.40
7.3.210.0060.01216.53
7.3.200.0190.00419.39
7.3.190.0030.01416.46
7.3.180.0040.01216.53
7.3.170.0120.00616.57
7.3.160.0130.00316.28
7.3.120.0070.01114.83
7.3.110.0000.01514.59
7.3.100.0070.00714.83
7.3.90.0060.00615.04
7.3.80.0000.01114.76
7.3.70.0070.00714.63
7.3.60.0030.01214.73
7.3.50.0060.00914.65
7.3.40.0040.01114.72
7.3.30.0030.01014.77
7.3.20.0030.00716.58
7.3.10.0030.01316.59
7.3.00.0040.01116.72
7.2.330.0130.00416.78
7.2.320.0060.01216.54
7.2.310.0170.00016.76
7.2.300.0000.01816.74
7.2.290.0100.00716.59
7.2.240.0030.01014.95
7.2.230.0000.01514.96
7.2.220.0000.01815.07
7.2.210.0040.01414.94
7.2.200.0040.00815.02
7.2.190.0100.00614.77
7.2.180.0070.00714.76
7.2.170.0030.01314.88
7.2.160.0120.00314.90
7.2.150.0130.00316.55
7.2.140.0080.00416.84
7.2.130.0070.01116.72
7.2.120.0060.00616.77
7.2.110.0070.01116.96
7.2.100.0040.00716.66
7.2.90.0000.01616.94
7.2.80.0070.00716.81
7.2.70.0040.00816.77
7.2.60.0060.01316.97
7.2.50.0070.01116.80
7.2.40.0070.00716.98
7.2.30.0100.00617.09
7.2.20.0060.00617.01
7.2.10.0090.01216.93
7.2.00.0080.01118.08
7.1.330.0160.00015.57
7.1.320.0060.00915.55
7.1.310.0030.01015.60
7.1.300.0090.00615.83
7.1.290.0070.01015.81
7.1.280.0030.01315.79
7.1.270.0060.00915.93
7.1.260.0070.00715.49
7.1.250.0030.00715.94
7.1.100.0690.01116.31
7.1.70.0110.00417.03
7.1.60.0030.02019.22
7.1.50.0040.00716.77
7.1.00.0030.07722.36
7.0.200.0030.00716.77
7.0.140.0070.03722.18
7.0.60.0030.05019.96
7.0.50.0300.05317.97
7.0.40.0230.07020.13
7.0.30.0170.04720.30
7.0.20.0330.06720.20
7.0.10.0070.08020.15
7.0.00.0070.07720.43
5.6.280.0000.07720.92
5.6.210.0170.07320.54
5.6.200.0100.05718.15
5.6.190.0070.05020.65
5.6.180.0200.05720.33
5.6.170.0300.06320.50
5.6.160.0030.05020.44
5.6.150.0070.08018.20
5.6.140.0100.07318.12
5.6.130.0030.05718.15
5.6.120.0100.08021.03
5.6.110.0070.06321.12
5.6.100.0170.07721.12
5.6.90.0100.07721.11
5.6.80.0100.05020.38
5.6.70.0370.06720.42
5.5.350.0030.08320.45
5.5.340.0100.05018.04
5.5.330.0070.04720.46
5.5.320.0270.06720.32
5.5.310.0300.07720.27
5.5.300.0030.08018.07
5.5.290.0030.08317.99
5.5.280.0070.04020.90
5.5.270.0030.06020.74
5.5.260.0030.07020.74
5.5.250.0100.07720.48
5.5.240.0100.07720.30
5.4.450.0570.06019.58
5.4.440.0570.04719.39
5.4.430.0130.05319.29
5.4.420.0070.06319.39
5.4.410.0130.05719.38
5.4.400.0100.05719.20
5.4.390.0170.05018.72
5.4.380.0200.04718.56
5.4.370.0170.04718.61
5.4.360.0200.04718.51
5.4.350.0230.05018.78
5.4.340.0130.05718.50
5.4.320.0100.05718.79
5.4.310.0200.05318.80
5.4.300.0100.05718.78
5.4.290.0070.05718.47
5.4.280.0170.05018.79
5.4.270.0200.04718.61
5.4.260.0000.06318.73
5.4.250.0200.05018.71
5.4.240.0170.05018.53
5.4.230.0100.05718.63
5.4.220.0170.06018.73
5.4.210.0100.05718.70
5.4.200.0170.04716.80
5.4.190.0170.04718.59
5.4.180.0100.05318.52
5.4.170.0230.04318.73
5.4.160.0170.05018.69
5.4.150.0170.05018.55
5.4.140.0100.06716.33
5.4.130.0130.05016.33
5.4.120.0130.04716.22
5.4.110.0200.04316.22
5.4.100.0130.05316.33
5.4.90.0130.05316.27
5.4.80.0100.05316.23
5.4.70.0200.05716.22
5.4.60.0130.05716.41
5.4.50.0200.04016.27
5.4.40.0070.05716.28
5.4.30.0170.04716.29
5.4.20.0000.06316.23
5.4.10.0170.04316.39
5.4.00.0100.05015.76
5.3.290.0030.06314.70
5.3.280.0270.03714.62
5.3.270.0030.06314.62
5.3.260.0130.05314.62
5.3.250.0170.04714.66
5.3.240.0130.05314.76
5.3.230.0130.05014.61
5.3.220.0030.06314.62
5.3.210.0130.05314.56
5.3.200.0130.04714.56
5.3.190.0130.05014.67
5.3.180.0130.05014.80
5.3.170.0170.04714.59
5.3.160.0070.05714.69
5.3.150.0130.05014.55
5.3.140.0130.05714.60
5.3.130.0130.05314.60
5.3.120.0230.06314.67
5.3.110.0100.06014.77
5.3.100.0300.03714.04
5.3.90.0130.05714.00
5.3.80.0270.05714.21
5.3.70.0130.05014.04
5.3.60.0170.05014.04
5.3.50.0100.05713.98
5.3.40.0130.04714.01
5.3.30.0100.05713.97
5.3.20.0100.05013.70
5.3.10.0070.05313.76
5.3.00.0070.05713.75
5.2.170.0130.04311.13
5.2.160.0100.04011.17
5.2.150.0130.03711.15
5.2.140.0130.03711.18
5.2.130.0000.05011.15
5.2.120.0130.03711.11
5.2.110.0070.04311.22
5.2.100.0170.04011.23
5.2.90.0130.03711.14
5.2.80.0170.05011.08
5.2.70.0100.04311.31
5.2.60.0130.04011.11
5.2.50.0070.04311.11
5.2.40.0100.04011.03
5.2.30.0130.03710.98
5.2.20.0130.03711.08
5.2.10.0100.04010.99
5.2.00.0130.03710.93
5.1.60.0130.03010.16
5.1.50.0130.03010.19
5.1.40.0170.04010.00
5.1.30.0070.04010.37
5.1.20.0070.04010.47
5.1.10.0100.03710.08
5.1.00.0170.03710.18
5.0.50.0070.0308.58
5.0.40.0030.0308.45
5.0.30.0070.0538.39
5.0.20.0070.0278.32
5.0.10.0070.0278.37
5.0.00.0030.0478.29
4.4.90.0000.0235.92
4.4.80.0030.0235.88
4.4.70.0070.0205.98
4.4.60.0070.0205.93
4.4.50.0030.0235.93
4.4.40.0000.0405.88
4.4.30.0070.0205.87
4.4.20.0070.0205.97
4.4.10.0100.0175.93
4.4.00.0070.0335.94
4.3.110.0000.0275.84
4.3.100.0070.0205.85
4.3.90.0030.0205.79
4.3.80.0030.0335.86
4.3.70.0000.0235.81
4.3.60.0070.0175.91
4.3.50.0030.0235.81
4.3.40.0000.0375.79
4.3.30.0000.0274.61
4.3.20.0000.0234.66
4.3.10.0000.0234.52
4.3.00.0130.0237.30

preferences:
54.63 ms | 400 KiB | 5 Q