3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj implements arrayaccess { private $container = array(); public function __construct() { $this->container = array( "one" => 1, "two" => 2, "three" => 3, ); } public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } public function offsetExists($offset) { return isset($this->container[$offset]); } public function offsetUnset($offset) { unset($this->container[$offset]); } public function offsetGet($offset) { var_dump($this->container); return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $obj = new obj; $obj["6"]["7"] = 7; var_dump($obj["two"]["2"]); var_dump($obj["6"]["7"]);

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.0110.01118.68
8.3.50.0070.01221.92
8.3.40.0140.00718.79
8.3.30.0110.00419.09
8.3.20.0040.00420.20
8.3.10.0080.00022.09
8.3.00.0090.00022.39
8.2.180.0130.01016.75
8.2.170.0120.00322.96
8.2.160.0160.00321.02
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.01426.16
8.2.120.0080.00019.36
8.2.110.0040.00422.25
8.2.100.0060.00617.72
8.2.90.0000.00819.35
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0030.00518.16
8.2.30.0000.00718.18
8.2.20.0040.00417.68
8.2.10.0040.00417.74
8.2.00.0030.00617.64
8.1.280.0070.00725.92
8.1.270.0150.00321.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.92
8.1.230.0000.01119.01
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00717.34
8.1.190.0000.00817.30
8.1.180.0040.00418.81
8.1.170.0080.00018.41
8.1.160.0070.00022.08
8.1.150.0000.00818.65
8.1.140.0000.00817.38
8.1.130.0080.00317.80
8.1.120.0040.00417.45
8.1.110.0040.00417.35
8.1.100.0000.00717.38
8.1.90.0030.00317.40
8.1.80.0000.00717.48
8.1.70.0030.00317.38
8.1.60.0050.00317.62
8.1.50.0030.00617.57
8.1.40.0030.00617.54
8.1.30.0040.00417.64
8.1.20.0000.00817.62
8.1.10.0040.00417.62
8.1.00.0060.00317.54
8.0.300.0040.00418.77
8.0.290.0020.00517.05
8.0.280.0050.00318.38
8.0.270.0040.00417.31
8.0.260.0030.00316.90
8.0.250.0060.00317.00
8.0.240.0070.00017.05
8.0.230.0040.00417.04
8.0.220.0070.00016.86
8.0.210.0070.00017.00
8.0.200.0000.00717.04
8.0.190.0040.00417.07
8.0.180.0070.00016.92
8.0.170.0060.00316.99
8.0.160.0040.00416.95
8.0.150.0070.00016.92
8.0.140.0000.00716.99
8.0.130.0060.00013.36
8.0.120.0030.00516.93
8.0.110.0000.00716.94
8.0.100.0000.00716.94
8.0.90.0000.00816.82
8.0.80.0140.00617.04
8.0.70.0000.00916.84
8.0.60.0070.00017.05
8.0.50.0000.00717.04
8.0.30.0150.00616.98
8.0.20.0130.00617.40
8.0.10.0000.00717.09
8.0.00.0110.00916.64
7.4.330.0050.00015.00
7.4.320.0000.00816.44
7.4.300.0000.00716.61
7.4.290.0000.00716.42
7.4.280.0030.00316.53
7.4.270.0000.00716.59
7.4.260.0030.00316.61
7.4.250.0040.00416.48
7.4.240.0020.00616.60
7.4.230.0070.00016.40
7.4.220.0090.00916.58
7.4.210.0090.00716.64
7.4.200.0030.00316.60
7.4.190.0000.00816.61
7.4.160.0090.00616.38
7.4.150.0090.01517.40
7.4.140.0080.01117.86
7.4.130.0110.01116.46
7.4.120.0130.00516.60
7.4.110.0100.00716.66
7.4.100.0090.00816.53
7.4.90.0070.01116.50
7.4.80.0100.00719.39
7.4.70.0060.01816.46
7.4.60.0090.00916.49
7.4.50.0030.00616.50
7.4.40.0070.00722.77
7.4.30.0030.01416.69
7.4.00.0000.01714.75
7.3.330.0000.00513.46
7.3.320.0020.00213.48
7.3.310.0030.00316.46
7.3.300.0070.00016.48
7.3.290.0060.00916.43
7.3.280.0080.01116.45
7.3.270.0100.00717.40
7.3.260.0180.00616.70
7.3.250.0120.01016.37
7.3.240.0140.00316.30
7.3.230.0170.00616.42
7.3.210.0170.00016.40
7.3.200.0180.00719.39
7.3.190.0070.01016.53
7.3.180.0080.00816.43
7.3.170.0200.00316.60
7.3.160.0090.00916.35
7.3.120.0060.00914.66
7.2.330.0030.01316.56
7.2.320.0060.01416.83
7.2.310.0030.01316.79
7.2.300.0070.01116.45
7.2.290.0110.00516.79
7.2.00.0090.00619.52
7.1.100.0800.00616.44
7.1.70.0040.00416.92
7.1.60.0190.00319.82
7.1.50.0060.00616.86
7.1.00.0100.07022.45
7.0.200.0080.00316.45
7.0.140.0000.07722.04
7.0.100.0170.05320.03
7.0.90.0100.06319.93
7.0.80.0030.08319.90
7.0.70.0130.04019.91
7.0.60.0030.04719.96
7.0.50.0030.09020.32
7.0.40.0100.05020.00
7.0.30.0130.07720.09
7.0.20.0230.06320.08
7.0.10.0170.07320.03
7.0.00.0200.07720.11
5.6.250.0030.08720.61
5.6.240.0100.08020.59
5.6.230.0130.07720.64
5.6.220.0100.07720.62
5.6.210.0030.08020.77
5.6.200.0130.08321.00
5.6.190.0100.07021.09
5.6.180.0200.06321.10
5.6.170.0170.07321.05
5.6.160.0170.07021.04
5.6.150.0030.08721.12
5.6.140.0070.06021.14
5.6.130.0100.08721.02
5.6.120.0070.05321.09
5.6.110.0030.08321.09
5.6.100.0170.07021.02
5.6.90.0030.08321.07
5.6.80.0030.06720.37
5.6.70.0170.07020.39
5.6.60.0130.07320.34
5.6.50.0130.07720.39
5.6.40.0070.08020.43
5.6.30.0070.08020.47
5.6.20.0070.07320.30
5.6.10.0130.06720.47
5.6.00.0130.06720.37
5.5.380.0000.08320.38
5.5.370.0100.08020.38
5.5.360.0170.07320.45
5.5.350.0100.08020.48
5.5.340.0170.07720.84
5.5.330.0130.04720.93
5.5.320.0170.05320.94
5.5.310.0030.08020.83
5.5.300.0200.07020.84
5.5.290.0130.07720.91
5.5.280.0070.08320.80
5.5.270.0070.06020.74
5.5.260.0030.07320.82
5.5.250.0100.07720.62
5.5.240.0130.07320.14
5.5.230.0070.07720.27
5.5.220.0070.06020.02
5.5.210.0130.05020.29
5.5.200.0230.05720.14
5.5.190.0170.07020.27
5.5.180.0070.08720.16
5.5.160.0170.06320.24
5.5.150.0170.07320.11
5.5.140.0100.07320.28
5.5.130.0070.07020.23
5.5.120.0100.07320.14
5.5.110.0030.08320.21
5.5.100.0130.08020.14
5.5.90.0170.07319.92
5.5.80.0200.06320.16
5.5.70.0100.07320.06
5.5.60.0170.07020.14
5.5.50.0100.07019.95
5.5.40.0030.08020.05
5.5.30.0030.06320.00
5.5.20.0130.07019.96
5.5.10.0070.07720.06
5.5.00.0170.07020.12
5.4.450.0170.07019.41
5.4.440.0100.07719.19
5.4.430.0070.04719.44
5.4.420.0130.06719.45
5.4.410.0100.07319.22
5.4.400.0070.07019.16
5.4.390.0070.07719.14
5.4.380.0070.07719.16
5.4.370.0170.05718.91
5.4.360.0130.07318.88
5.4.350.0030.08318.87
5.4.340.0070.08019.03
5.4.320.0100.07719.05
5.4.310.0100.07719.18
5.4.300.0030.08319.02
5.4.290.0170.06719.23
5.4.280.0130.07319.12
5.4.270.0170.06318.89
5.4.260.0000.04319.11
5.4.250.0070.07718.86
5.4.240.0070.07319.21
5.4.230.0100.06718.94
5.4.220.0100.05318.84
5.4.210.0070.08019.20
5.4.200.0100.04018.88
5.4.190.0030.08318.86
5.4.180.0100.07018.89
5.4.170.0130.06718.94
5.4.160.0200.06319.03
5.4.150.0100.05319.16
5.4.140.0100.07016.47
5.4.130.0070.07316.32
5.4.120.0070.07316.42
5.4.110.0030.07716.43
5.4.100.0130.07016.39
5.4.90.0100.06316.43
5.4.80.0070.06716.34
5.4.70.0070.07716.34
5.4.60.0100.05016.42
5.4.50.0100.07316.39
5.4.40.0130.07016.53
5.4.30.0030.05016.43
5.4.20.0130.07016.40
5.4.10.0070.06716.29
5.4.00.0030.07015.83
5.3.290.0170.06714.66
5.3.280.0070.07014.71
5.3.270.0100.07014.75
5.3.260.0100.04014.72
5.3.250.0100.07014.64
5.3.240.0130.06314.67
5.3.230.0100.07314.66
5.3.220.0070.06314.64
5.3.210.0070.06014.71
5.3.200.0070.07014.56
5.3.190.0100.07314.68
5.3.180.0070.07314.58
5.3.170.0030.07714.52
5.3.160.0070.03314.68
5.3.150.0070.07714.69
5.3.140.0100.07714.52
5.3.130.0130.06314.57
5.3.120.0030.07014.61
5.3.110.0100.07314.52
5.3.100.0130.04714.02
5.3.90.0130.06014.05
5.3.80.0000.08314.16
5.3.70.0100.07313.95
5.3.60.0070.06714.13
5.3.50.0170.06713.88
5.3.40.0070.07313.98
5.3.30.0100.06714.05
5.3.20.0170.05313.62
5.3.10.0030.07013.67
5.3.00.0030.07013.77
5.2.170.0030.04011.07
5.2.160.0100.06011.27
5.2.150.0100.06011.18
5.2.140.0070.05711.24
5.2.130.0100.05711.17
5.2.120.0170.05011.21
5.2.110.0100.05711.16
5.2.100.0070.06011.25
5.2.90.0030.05711.16
5.2.80.0030.05710.97
5.2.70.0030.06011.09
5.2.60.0030.06011.20
5.2.50.0070.05311.04
5.2.40.0030.06710.91
5.2.30.0030.06310.86
5.2.20.0030.05010.98
5.2.10.0030.04710.98
5.2.00.0100.06010.64
5.1.60.0100.04310.49
5.1.50.0100.03310.49
5.1.40.0130.04310.49
5.1.30.0030.04010.49
5.1.20.0000.06010.49
5.1.10.0100.05010.49
5.1.00.0100.05010.49
5.0.50.0070.03710.49
5.0.40.0000.04710.49
5.0.30.0030.05010.49
5.0.20.0070.03710.49
5.0.10.0030.03310.49
5.0.00.0030.06710.49
4.4.90.0030.03010.49
4.4.80.0000.03710.49
4.4.70.0000.03710.49
4.4.60.0030.03710.49
4.4.50.0000.03310.49
4.4.40.0070.05010.49
4.4.30.0070.03310.49
4.4.20.0030.03310.49
4.4.10.0000.02310.49
4.4.00.0030.05310.49
4.3.110.0030.02710.49
4.3.100.0100.01710.49
4.3.90.0000.03710.49
4.3.80.0070.04710.49
4.3.70.0000.02710.49
4.3.60.0030.03310.49
4.3.50.0000.03010.49
4.3.40.0030.05010.49
4.3.30.0000.03010.49
4.3.20.0100.01010.49
4.3.10.0000.03710.49
4.3.00.0000.03710.49

preferences:
52.95 ms | 401 KiB | 5 Q