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; } $tconfig =& $config[$key]; $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.70.0080.01116.75
8.3.60.0150.00618.15
8.3.50.0160.00522.11
8.3.40.0070.00718.83
8.3.30.0070.00718.79
8.3.20.0080.00020.16
8.3.10.0000.00723.48
8.3.00.0070.00019.02
8.2.180.0190.00018.41
8.2.170.0140.00022.96
8.2.160.0100.00322.21
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00320.98
8.2.110.0090.00022.02
8.2.100.0060.00617.72
8.2.90.0050.00317.50
8.2.80.0030.00618.67
8.2.70.0050.00317.93
8.2.60.0040.00417.88
8.2.50.0050.00318.10
8.2.40.0040.00419.41
8.2.30.0000.00819.37
8.2.20.0000.00717.82
8.2.10.0000.00818.02
8.2.00.0040.00417.75
8.1.280.0100.01025.92
8.1.270.0060.00318.86
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0040.00423.94
8.1.230.0090.00321.03
8.1.220.0060.00317.74
8.1.210.0030.00518.77
8.1.200.0030.00717.47
8.1.190.0050.00317.25
8.1.180.0050.00318.86
8.1.170.0040.00418.63
8.1.160.0000.00719.03
8.1.150.0000.00718.94
8.1.140.0000.00717.41
8.1.130.0030.00517.80
8.1.120.0000.00717.37
8.1.110.0030.00517.54
8.1.100.0070.00017.35
8.1.90.0030.00417.50
8.1.80.0040.00417.50
8.1.70.0070.00017.30
8.1.60.0000.00917.56
8.1.50.0090.00017.53
8.1.40.0000.00717.47
8.1.30.0030.00517.72
8.1.20.0040.00417.68
8.1.10.0040.00417.61
8.1.00.0040.00417.58
8.0.300.0000.00818.77
8.0.290.0080.00016.63
8.0.280.0000.00818.40
8.0.270.0060.00317.21
8.0.260.0040.00417.26
8.0.250.0070.00017.01
8.0.240.0030.00316.88
8.0.230.0000.00816.88
8.0.220.0040.00416.83
8.0.210.0040.00416.96
8.0.200.0030.00316.96
8.0.190.0000.00816.86
8.0.180.0000.00716.82
8.0.170.0050.00216.93
8.0.160.0030.00516.95
8.0.150.0040.00416.85
8.0.140.0040.00416.89
8.0.130.0030.00313.32
8.0.120.0030.00516.84
8.0.110.0000.00716.96
8.0.100.0040.00416.77
8.0.90.0040.00416.83
8.0.80.0140.00716.89
8.0.70.0000.00716.84
8.0.60.0070.00016.73
8.0.50.0040.00416.96
8.0.30.0110.00717.02
8.0.20.0100.01317.40
8.0.10.0040.00417.01
8.0.00.0130.00516.64
7.4.330.0050.00015.05
7.4.320.0060.00016.51
7.4.300.0030.00316.48
7.4.290.0040.00416.61
7.4.280.0030.00516.65
7.4.270.0000.00716.54
7.4.260.0030.00316.59
7.4.250.0040.00416.37
7.4.240.0030.00416.60
7.4.230.0030.00416.61
7.4.220.0070.01416.65
7.4.210.0090.00916.69
7.4.200.0000.00716.61
7.4.160.0120.00316.51
7.4.150.0060.01217.40
7.4.140.0090.00917.86
7.4.130.0080.01316.55
7.4.120.0120.00516.52
7.4.110.0210.00516.52
7.4.100.0100.01416.40
7.4.90.0160.00616.52
7.4.80.0040.01519.39
7.4.70.0090.01316.56
7.4.60.0070.01016.45
7.4.50.0040.00416.33
7.4.40.0060.01216.57
7.4.30.0170.00016.71
7.4.00.0000.01014.90
7.3.330.0000.00513.38
7.3.320.0020.00313.31
7.3.310.0040.00416.41
7.3.300.0030.00316.42
7.3.290.0080.00816.38
7.3.280.0120.00616.37
7.3.270.0190.00317.40
7.3.260.0100.00616.65
7.3.250.0100.00716.55
7.3.240.0030.02016.36
7.3.230.0080.00816.42
7.3.210.0080.01116.53
7.3.200.0110.01119.39
7.3.190.0060.01116.55
7.3.180.0140.00316.53
7.3.170.0040.01616.48
7.3.160.0110.00716.38
7.3.120.0040.00815.05
7.3.110.0050.00515.11
7.3.100.0070.00414.66
7.3.90.0040.00814.59
7.3.80.0040.00714.66
7.3.70.0000.01014.62
7.3.60.0060.00614.70
7.3.50.0030.00814.88
7.3.40.0070.00814.55
7.3.30.0040.00814.98
7.3.20.0040.00816.58
7.3.10.0170.00216.39
7.3.00.0130.00716.53
7.2.330.0060.01216.59
7.2.320.0100.00716.88
7.2.310.0080.01216.65
7.2.300.0190.00316.90
7.2.290.0110.01116.79
7.2.250.0000.01215.09
7.2.240.0030.00914.98
7.2.230.0090.00415.09
7.2.220.0000.01214.79
7.2.210.0060.00615.14
7.2.200.0030.00915.14
7.2.190.0090.00315.29
7.2.180.0090.00614.98
7.2.170.0100.00315.12
7.2.160.0030.01015.18
7.2.150.0070.00316.83
7.2.140.0060.00616.70
7.2.130.0070.00716.88
7.2.120.0110.00916.66
7.2.110.0020.01216.78
7.2.100.0080.01016.65
7.2.90.0110.00716.77
7.2.80.0080.00616.82
7.2.70.0120.00816.76
7.2.60.0100.00816.61
7.2.50.0080.00816.90
7.2.40.0110.00616.65
7.2.30.0080.01016.63
7.2.20.0060.00916.69
7.2.10.0100.00516.63
7.2.00.0060.00817.54
7.1.330.0000.01115.76
7.1.320.0040.00715.61
7.1.310.0040.00715.85
7.1.300.0000.01115.83
7.1.290.0030.00915.95
7.1.280.0040.00815.62
7.1.270.0060.00615.60
7.1.260.0070.00415.71
7.1.250.0050.00915.69
7.1.100.0400.01516.07
7.1.70.0050.00217.07
7.1.60.0140.01019.22
7.1.50.0000.01416.96
7.1.00.0000.08022.45
7.0.200.0030.00716.83
7.0.140.0100.06721.93
7.0.110.0670.08019.98
7.0.100.0530.08319.95
7.0.90.0400.06020.02
7.0.80.0600.07719.87
7.0.70.0630.06720.09
7.0.60.0600.09020.04
7.0.50.0530.05320.32
7.0.40.0100.08020.25
7.0.30.0070.08020.19
7.0.20.0070.08020.05
7.0.10.0070.08020.14
7.0.00.0200.06720.23
5.6.280.0030.07321.08
5.6.250.0130.07020.61
5.6.240.0200.03720.87
5.6.230.0100.07320.55
5.6.220.0100.07720.69
5.6.210.0100.07720.64
5.6.200.0170.07021.30
5.6.190.0000.07321.20
5.6.180.0130.04721.04
5.6.170.0030.08721.04
5.6.160.0070.08321.10
5.6.150.0100.07021.02
5.6.140.0130.07021.29
5.6.130.0070.05021.10
5.6.120.0170.07021.03
5.6.110.0170.06021.05
5.6.100.0100.04320.92
5.6.90.0130.08321.12
5.6.80.0200.06720.62
5.6.70.0070.08020.53
5.6.60.0000.08020.50
5.6.50.0100.07320.54
5.6.40.0070.04020.64
5.6.30.0130.07320.46
5.6.20.0070.05020.63
5.6.10.0100.06720.39
5.6.00.0130.07320.47
5.5.380.0070.06720.34
5.5.370.0070.07720.30
5.5.360.0000.09720.25
5.5.350.0030.08020.17
5.5.340.0130.06720.76
5.5.330.0070.08020.98
5.5.320.0130.08021.00
5.5.310.0070.08020.81
5.5.300.0030.07720.75
5.5.290.0130.07020.82
5.5.280.0100.04720.79
5.5.270.0230.06320.95
5.5.260.0070.08320.95
5.5.250.0130.07720.77
5.5.240.0100.08320.10
5.5.230.0030.07720.21
5.5.220.0070.08020.33
5.5.210.0030.05720.40
5.5.200.0100.07020.27
5.5.190.0100.07020.25
5.5.180.0130.05020.35
5.5.160.0130.08020.26
5.5.150.0070.06720.31
5.5.140.0070.07320.36
5.5.130.0000.08020.12
5.5.120.0000.04020.13
5.5.110.0070.05720.09
5.5.100.0070.03720.24
5.5.90.0030.04719.99
5.5.80.0000.04020.05
5.5.70.0030.04020.17
5.5.60.0030.03720.19
5.5.50.0030.04020.14
5.5.40.0000.04019.98
5.5.30.0100.04320.22
5.5.20.0070.05320.07
5.5.10.0030.04320.02
5.5.00.0030.05320.11
5.4.450.0070.08019.34
5.4.440.0130.07719.34
5.4.430.0070.06019.33
5.4.420.0000.04719.36
5.4.410.0030.05019.18
5.4.400.0100.08019.09
5.4.390.0100.04019.22
5.4.380.0030.07719.31
5.4.370.0130.07319.18
5.4.360.0070.05019.27
5.4.350.0070.07719.02
5.4.340.0100.07719.02
5.4.320.0100.07019.02
5.4.310.0070.04719.24
5.4.300.0000.04719.22
5.4.290.0070.03319.03
5.4.280.0000.07319.13
5.4.270.0130.04719.17
5.4.260.0100.07018.98
5.4.250.0030.03718.95
5.4.240.0000.04319.17
5.4.230.0000.04019.00
5.4.220.0100.03019.20
5.4.210.0030.03718.96
5.4.200.0070.03319.00
5.4.190.0030.04018.97
5.4.180.0070.05019.21
5.4.170.0130.03319.21
5.4.160.0100.06319.16
5.4.150.0000.04319.07
5.4.140.0030.04016.38
5.4.130.0100.04316.36
5.4.120.0070.03016.29
5.4.110.0000.03716.52
5.4.100.0000.04016.63
5.4.90.0000.04016.59
5.4.80.0030.04716.39
5.4.70.0100.02716.50
5.4.60.0000.03716.40
5.4.50.0030.03716.56
5.4.40.0000.05316.53
5.4.30.0030.03316.50
5.4.20.0000.04316.33
5.4.10.0030.03716.23
5.4.00.0000.03715.99
5.3.290.0130.06014.81
5.3.280.0100.03314.45
5.3.270.0070.03314.68
5.3.260.0000.04714.59
5.3.250.0100.03014.68
5.3.240.0000.04014.73
5.3.230.0030.07714.46
5.3.220.0070.03314.52
5.3.210.0030.07014.60
5.3.200.0070.05014.59
5.3.190.0000.04014.69
5.3.180.0030.03314.58
5.3.170.0030.03714.69
5.3.160.0070.03714.79
5.3.150.0070.07714.59
5.3.140.0030.03714.42
5.3.130.0000.03714.77
5.3.120.0000.06314.54
5.3.110.0000.04014.50
5.3.100.0030.03714.17
5.3.90.0000.04314.00
5.3.80.0000.04014.24
5.3.70.0000.04014.12
5.3.60.0000.04014.09
5.3.50.0030.03313.96
5.3.40.0030.03313.90
5.3.30.0130.02314.01
5.3.20.0130.02313.54
5.3.10.0070.04013.64
5.3.00.0000.04013.61
5.2.170.0030.04711.14
5.2.160.0030.02711.10
5.2.150.0000.03011.11
5.2.140.0030.02711.21
5.2.130.0000.03011.15
5.2.120.0000.05711.15
5.2.110.0030.02311.08
5.2.100.0100.06711.07
5.2.90.0100.04311.18
5.2.80.0100.03711.06
5.2.70.0000.03011.16
5.2.60.0030.02711.03
5.2.50.0000.06710.86
5.2.40.0030.06011.21
5.2.30.0070.06011.04
5.2.20.0070.03310.95
5.2.10.0130.04010.85
5.2.00.0070.04710.72
5.1.60.0030.0539.81
5.1.50.0030.06310.05
5.1.40.0100.04710.13
5.1.30.0070.05710.34
5.1.20.0070.05710.41
5.1.10.0200.04010.24
5.1.00.0100.05010.31
5.0.50.0030.0278.61
5.0.40.0070.0278.66
5.0.30.0030.0638.19
5.0.20.0000.0578.15
5.0.10.0100.0378.24
5.0.00.0000.0578.12
4.4.90.0000.0177.99
4.4.80.0000.0177.99
4.4.70.0070.0307.99
4.4.60.0030.0307.99
4.4.50.0030.0207.99
4.4.40.0030.0577.99
4.4.30.0070.0337.99
4.4.20.0000.0377.99
4.4.10.0000.0377.99
4.4.00.0070.0507.99
4.3.110.0030.0377.99
4.3.100.0070.0307.99
4.3.90.0130.0207.99
4.3.80.0030.0507.99
4.3.70.0030.0337.99
4.3.60.0000.0377.99
4.3.50.0000.0337.99
4.3.40.0030.0407.99
4.3.30.0000.0377.99
4.3.20.0030.0377.99
4.3.10.0030.0337.99
4.3.00.0030.0337.99

preferences:
56 ms | 401 KiB | 5 Q