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; 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.0070.01016.75
8.3.50.0050.01516.61
8.3.40.0120.00318.97
8.3.30.0080.00618.97
8.3.20.0040.00418.91
8.3.10.0040.00420.48
8.3.00.0140.00017.34
8.2.180.0100.01016.63
8.2.170.0070.00722.96
8.2.160.0100.00320.39
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00519.49
8.2.110.0110.00021.12
8.2.100.0080.00417.86
8.2.90.0030.00620.94
8.2.80.0040.00418.16
8.2.70.0030.00617.50
8.2.60.0000.00818.16
8.2.50.0090.00018.07
8.2.40.0000.00818.16
8.2.30.0000.00818.01
8.2.20.0000.00817.73
8.2.10.0040.00417.67
8.2.00.0000.00817.86
8.1.280.0040.01125.92
8.1.270.0080.00024.66
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00620.68
8.1.230.0040.00720.86
8.1.220.0040.00417.79
8.1.210.0040.00418.84
8.1.200.0090.00317.35
8.1.190.0040.00417.55
8.1.180.0040.00418.10
8.1.170.0080.00018.87
8.1.160.0030.00518.96
8.1.150.0070.00018.57
8.1.140.0050.00217.39
8.1.130.0000.00717.86
8.1.120.0040.00417.55
8.1.110.0030.00517.47
8.1.100.0040.00417.46
8.1.90.0000.00717.48
8.1.80.0040.00417.47
8.1.70.0040.00417.49
8.1.60.0030.00617.63
8.1.50.0040.00417.54
8.1.40.0040.00417.53
8.1.30.0000.00817.66
8.1.20.0080.00017.66
8.1.10.0000.00817.64
8.1.00.0040.00417.53
8.0.300.0030.00619.93
8.0.290.0000.00916.63
8.0.280.0000.00818.38
8.0.270.0030.00317.21
8.0.260.0070.00016.91
8.0.250.0030.00517.01
8.0.240.0050.00316.94
8.0.230.0040.00416.92
8.0.220.0060.00316.86
8.0.210.0000.00616.98
8.0.200.0030.00317.03
8.0.190.0030.00516.89
8.0.180.0070.00017.07
8.0.170.0090.00016.97
8.0.160.0000.00717.03
8.0.150.0000.01016.82
8.0.140.0040.00416.84
8.0.130.0030.00313.40
8.0.120.0040.00416.86
8.0.110.0040.00416.97
8.0.100.0080.00016.90
8.0.90.0000.00816.82
8.0.80.0040.01117.00
8.0.70.0040.00416.86
8.0.60.0000.00716.74
8.0.50.0030.00516.92
8.0.30.0110.00816.95
8.0.20.0150.00717.16
8.0.10.0070.00017.00
8.0.00.0140.00716.76
7.4.330.0050.00013.00
7.4.320.0030.00316.61
7.4.300.0070.00016.52
7.4.290.0000.00716.59
7.4.280.0040.00416.62
7.4.270.0020.00516.43
7.4.260.0030.00313.29
7.4.250.0040.00416.50
7.4.240.0090.00016.62
7.4.230.0050.00316.43
7.4.220.0070.01416.46
7.4.210.0100.00616.51
7.4.200.0030.00316.42
7.4.190.0000.00716.75
7.4.160.0030.01316.42
7.4.150.0090.00916.47
7.4.140.0110.00916.61
7.4.130.0080.01016.56
7.4.120.0090.00816.41
7.4.110.0090.00916.60
7.4.100.0030.01516.66
7.4.90.0120.00616.69
7.4.80.0140.00719.39
7.4.70.0090.01516.49
7.4.60.0050.01616.54
7.4.50.0000.00816.48
7.4.40.0100.00716.54
7.4.30.0110.00516.37
7.4.00.0130.00314.87
7.3.330.0000.00613.16
7.3.320.0030.00313.48
7.3.310.0000.00816.23
7.3.300.0030.00316.42
7.3.290.0120.00416.37
7.3.280.0090.01016.35
7.3.270.0110.01516.34
7.3.260.0120.00716.64
7.3.250.0110.00716.53
7.3.240.0140.00516.62
7.3.230.0120.01216.39
7.3.210.0140.00316.44
7.3.200.0030.01316.68
7.3.190.0100.00716.33
7.3.180.0110.00416.52
7.3.170.0090.00916.55
7.3.160.0140.00516.42
7.3.120.0090.00914.75
7.3.10.0060.00916.66
7.3.00.0080.00316.72
7.2.330.0120.00916.77
7.2.320.0110.00616.66
7.2.310.0140.01016.86
7.2.300.0090.01316.70
7.2.290.0130.01016.73
7.2.130.0030.00617.03
7.2.120.0070.00717.03
7.2.110.0070.00716.89
7.2.100.0090.00616.91
7.2.90.0030.01316.95
7.2.80.0080.00416.64
7.2.70.0000.01317.11
7.2.60.0050.00917.04
7.2.50.0100.00716.99
7.2.40.0080.00616.99
7.2.30.0070.00416.95
7.2.20.0040.01116.75
7.2.10.0060.00817.01
7.2.00.0060.00616.72
7.1.250.0030.00615.85
7.1.200.0030.00715.86
7.1.70.0060.00317.16
7.1.60.0060.01819.40
7.1.50.0270.01034.81
7.1.00.0070.07022.44
7.0.200.0000.00816.46
7.0.140.0000.07722.00
7.0.120.0030.07322.16
7.0.60.0070.06319.88
7.0.50.0030.04017.97
7.0.40.0030.07320.31
7.0.30.0200.08720.11
7.0.20.0270.05020.30
7.0.10.0170.04720.24
7.0.00.0030.04720.25
5.6.280.0070.07021.11
5.6.210.0030.06320.54
5.6.200.0070.05318.13
5.6.190.0070.04320.79
5.6.180.0170.04320.67
5.6.170.0170.04720.54
5.6.160.0070.06320.44
5.6.150.0070.08318.29
5.6.140.0100.03318.27
5.6.130.0100.03718.15
5.6.120.0070.05321.16
5.6.110.0130.07720.99
5.6.100.0100.05320.90
5.6.90.0170.07721.02
5.6.80.0130.06320.54
5.6.70.4570.03720.39
5.5.350.0300.07020.36
5.5.340.0000.09018.04
5.5.330.0100.06320.27
5.5.320.0230.03720.31
5.5.310.0130.04720.51
5.5.300.0100.08018.08
5.5.290.0200.07317.98
5.5.280.0070.03720.95
5.5.270.0070.05720.89
5.5.260.0230.06320.77
5.5.250.0100.05320.62
5.5.240.0070.05720.16
5.4.450.0030.07719.57
5.4.440.0070.05719.41
5.4.430.0000.08719.56
5.4.420.0130.05019.46
5.4.410.0070.03719.12
5.4.400.0070.07718.92
5.4.390.0070.07318.98
5.4.380.0100.06018.98
5.4.370.0000.04718.97
5.4.360.0030.07018.92
5.4.350.0030.08019.20
5.4.340.0130.06318.97
5.4.320.0030.03719.15
5.4.310.0100.07019.15
5.4.300.0030.08019.14
5.4.290.0070.07319.23
5.4.280.0070.07719.11
5.4.270.0030.05718.98
5.4.260.0100.04719.14
5.4.250.0000.07318.84
5.4.240.0030.06019.14
5.4.230.0200.06719.19
5.4.220.0070.08019.11
5.4.210.0100.06019.14
5.4.200.0100.04719.23
5.4.190.0100.03318.86
5.4.180.0100.07319.07
5.4.170.0070.04719.14
5.4.160.0070.07719.22
5.4.150.0070.07018.98
5.4.140.0070.06716.40
5.4.130.0070.06016.32
5.4.120.0070.07316.30
5.4.110.0100.07316.37
5.4.100.0170.05316.41
5.4.90.0030.04716.30
5.4.80.0070.08016.45
5.4.70.0130.03716.40
5.4.60.0030.07716.40
5.4.50.0100.07016.64
5.4.40.0070.07016.44
5.4.30.0030.04016.38
5.4.20.0030.04016.44
5.4.10.0070.04716.27
5.4.00.0100.03315.77
5.3.290.0030.04014.70
5.3.280.0070.07014.66
5.3.270.0030.05714.66
5.3.260.0170.05314.61
5.3.250.0070.07714.63
5.3.240.0100.04314.64
5.3.230.0030.07314.61
5.3.220.0130.06714.61
5.3.210.0200.06714.62
5.3.200.0100.07314.46
5.3.190.0100.07014.63
5.3.180.0070.07714.61
5.3.170.0100.08014.62
5.3.160.0030.07714.59
5.3.150.0030.07714.64
5.3.140.0030.08014.63
5.3.130.0070.07014.57
5.3.120.0000.08714.61
5.3.110.0100.07014.59
5.3.100.0070.03714.10
5.3.90.0100.05314.09
5.3.80.0100.03714.05
5.3.70.0130.06714.04
5.3.60.0030.03713.90
5.3.50.0070.06314.11
5.3.40.0030.05013.99
5.3.30.0130.07013.88
5.3.20.0070.04313.86
5.3.10.0100.03013.71
5.3.00.0070.06713.65
5.2.170.0030.05711.11
5.2.160.0070.03711.22
5.2.150.0100.06011.21
5.2.140.0000.03311.12
5.2.130.0100.05011.21
5.2.120.0070.06011.19
5.2.110.0030.06311.12
5.2.100.0100.05711.08
5.2.90.0070.04711.11
5.2.80.0100.04311.03
5.2.70.0070.06311.18
5.2.60.0070.06310.95
5.2.50.0030.06311.03
5.2.40.0000.04710.96
5.2.30.0030.03310.93
5.2.20.0000.06010.94
5.2.10.0000.06711.02
5.2.00.0030.05710.79
5.1.60.0070.05310.07
5.1.50.0070.0509.91
5.1.40.0070.0539.95
5.1.30.0070.06010.27
5.1.20.0030.05710.41
5.1.10.0030.0609.99
5.1.00.0130.04710.06
5.0.50.0030.0338.70
5.0.40.0030.0408.44
5.0.30.0030.0408.33
5.0.20.0000.0478.33
5.0.10.0000.0238.33
5.0.00.0000.0338.33
4.4.90.0100.0308.33
4.4.80.0030.0208.33
4.4.70.0000.0338.33
4.4.60.0030.0378.33
4.4.50.0030.0308.33
4.4.40.0000.0578.33
4.4.30.0070.0338.33
4.4.20.0070.0208.33
4.4.10.0000.0408.33
4.4.00.0070.0308.33
4.3.110.0000.0278.33
4.3.100.0000.0338.33
4.3.90.0000.0208.33
4.3.80.0000.0408.33
4.3.70.0030.0138.33
4.3.60.0000.0378.33
4.3.50.0030.0338.33
4.3.40.0030.0538.33
4.3.30.0000.0378.33
4.3.20.0070.0338.33
4.3.10.0030.0378.33
4.3.00.0000.0338.33

preferences:
38 ms | 401 KiB | 5 Q