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($offset); 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.0040.01118.43
8.3.50.0150.00822.10
8.3.40.0100.00719.00
8.3.30.0100.00319.08
8.3.20.0100.00320.20
8.3.10.0070.00023.54
8.3.00.0110.00017.38
8.2.180.0100.00718.36
8.2.170.0100.00722.96
8.2.160.0120.00820.57
8.2.150.0080.00024.18
8.2.140.0040.01124.66
8.2.130.0170.00026.16
8.2.120.0080.00022.28
8.2.110.0100.00722.18
8.2.100.0040.00817.91
8.2.90.0080.00019.23
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0000.00818.04
8.2.50.0000.00918.07
8.2.40.0040.00418.16
8.2.30.0020.00518.15
8.2.20.0040.00417.70
8.2.10.0060.00317.76
8.2.00.0000.01017.76
8.1.280.0070.01325.92
8.1.270.0070.01023.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0070.00319.07
8.1.220.0040.00417.76
8.1.210.0030.00518.77
8.1.200.0000.01017.35
8.1.190.0000.00817.53
8.1.180.0000.00818.10
8.1.170.0100.00018.32
8.1.160.0030.00621.94
8.1.150.0040.00418.71
8.1.140.0070.00017.52
8.1.130.0040.00417.71
8.1.120.0050.00217.50
8.1.110.0040.00417.49
8.1.100.0030.00717.38
8.1.90.0070.00017.44
8.1.80.0030.00317.40
8.1.70.0000.00717.41
8.1.60.0040.00417.50
8.1.50.0000.00817.54
8.1.40.0040.00417.55
8.1.30.0060.00317.61
8.1.20.0000.00817.64
8.1.10.0040.00417.49
8.1.00.0000.00817.44
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0000.00718.38
8.0.270.0030.00517.28
8.0.260.0040.00416.81
8.0.250.0030.00317.04
8.0.240.0000.00816.92
8.0.230.0070.00016.99
8.0.220.0070.00016.95
8.0.210.0000.00716.91
8.0.200.0040.00416.90
8.0.190.0080.00017.04
8.0.180.0000.00716.98
8.0.170.0060.00317.00
8.0.160.0000.00816.85
8.0.150.0040.00416.92
8.0.140.0060.00316.89
8.0.130.0040.00413.34
8.0.120.0000.00816.97
8.0.110.0040.00417.04
8.0.100.0020.00516.95
8.0.90.0070.00016.96
8.0.80.0070.01016.91
8.0.70.0000.00716.93
8.0.60.0000.00716.88
8.0.50.0050.00217.01
8.0.30.0110.00817.24
8.0.20.0140.00517.40
8.0.10.0000.00717.16
8.0.00.0090.01116.70
7.4.330.0020.00215.01
7.4.320.0040.00416.51
7.4.300.0060.00016.63
7.4.290.0000.00716.57
7.4.280.0040.00416.43
7.4.270.0030.00316.60
7.4.260.0000.00716.51
7.4.250.0040.00416.57
7.4.240.0050.00216.51
7.4.230.0000.00716.36
7.4.220.0130.00616.69
7.4.210.0100.00516.57
7.4.200.0050.00216.40
7.4.190.0000.00816.75
7.4.160.0060.01116.69
7.4.150.0100.00717.40
7.4.140.0030.01417.86
7.4.130.0130.00416.60
7.4.120.0080.00916.54
7.4.110.0140.00416.48
7.4.100.0120.01216.71
7.4.90.0110.00616.38
7.4.80.0060.01219.39
7.4.70.0080.01816.46
7.4.60.0030.01316.39
7.4.50.0060.00316.30
7.4.40.0090.00622.77
7.4.30.0090.00616.55
7.4.00.0070.01015.21
7.3.330.0000.00613.29
7.3.320.0060.00013.24
7.3.310.0030.00316.44
7.3.300.0030.00316.45
7.3.290.0100.00716.43
7.3.280.0110.00916.42
7.3.270.0090.00917.40
7.3.260.0040.01416.34
7.3.250.0080.01216.43
7.3.240.0100.00716.61
7.3.230.0150.00616.45
7.3.210.0100.00616.68
7.3.200.0060.01019.39
7.3.190.0090.01216.68
7.3.180.0090.00916.62
7.3.170.0080.00816.35
7.3.160.0070.01116.34
7.3.120.0090.00314.89
7.3.10.0070.00716.45
7.3.00.0050.00516.46
7.2.330.0070.01016.41
7.2.320.0070.01016.78
7.2.310.0160.00716.67
7.2.300.0060.01416.75
7.2.290.0080.00816.44
7.2.130.0060.00816.60
7.2.120.0050.00716.85
7.2.110.0040.01116.86
7.2.100.0040.01016.50
7.2.90.0050.00916.71
7.2.80.0120.00216.66
7.2.70.0060.00816.90
7.2.60.0050.00916.74
7.2.50.0050.00716.80
7.2.40.0110.00316.87
7.2.30.0030.01216.76
7.2.20.0080.00716.90
7.2.10.0050.01016.71
7.2.00.0060.00917.78
7.1.250.0060.00615.58
7.1.240.0040.00815.89
7.1.230.0100.00015.89
7.1.220.0030.01015.64
7.1.210.0070.00415.63
7.1.200.0080.00615.74
7.1.190.0000.01015.88
7.1.180.0060.00615.56
7.1.170.0070.00416.00
7.1.160.0100.00315.96
7.1.150.0100.00715.75
7.1.140.0040.00715.85
7.1.130.0030.00915.56
7.1.120.0070.00415.93
7.1.110.0070.00715.66
7.1.100.0060.00816.89
7.1.90.0050.00515.82
7.1.80.0110.00315.89
7.1.70.0080.00216.41
7.1.60.0110.00517.59
7.1.50.0110.00925.29
7.1.40.0040.01215.95
7.1.30.0070.01115.63
7.1.20.0040.01115.62
7.1.10.0000.01415.51
7.1.00.0050.04018.91
7.0.330.0030.00915.30
7.0.320.0000.01115.43
7.0.310.0060.00315.38
7.0.300.0040.00415.46
7.0.290.0070.00315.37
7.0.280.0030.00615.46
7.0.270.0060.00615.27
7.0.260.0060.01015.37
7.0.250.0000.01015.46
7.0.240.0030.00615.46
7.0.230.0060.00315.58
7.0.220.0040.00415.64
7.0.210.0030.00515.46
7.0.200.0050.00615.93
7.0.190.0160.00015.53
7.0.180.0070.00315.50
7.0.170.0040.00415.60
7.0.160.0110.00415.38
7.0.150.0050.00515.27
7.0.140.0080.03818.81
7.0.130.0030.01315.44
7.0.120.0070.00715.52
7.0.110.0040.00815.54
7.0.100.0060.02417.67
7.0.90.0060.02417.67
7.0.80.0050.02717.57
7.0.70.0070.02817.71
7.0.60.0050.02517.70
7.0.50.0080.02317.79
7.0.40.0020.02816.79
7.0.30.0030.02816.81
7.0.20.0080.02216.76
7.0.10.0040.02416.75
7.0.00.0120.03016.69
5.6.380.0000.01414.68
5.6.370.0090.00314.53
5.6.360.0050.00614.27
5.6.350.0040.00814.33
5.6.340.0060.00614.63
5.6.330.0030.00814.30
5.6.320.0060.00914.44
5.6.310.0060.00914.70
5.6.300.0080.00414.38
5.6.290.0060.01114.58
5.6.280.0090.03517.55
5.6.270.0120.00614.43
5.6.260.0050.00814.58
5.6.250.0080.02217.50
5.6.240.0040.02917.45
5.6.230.0090.02317.53
5.6.220.0050.03017.38
5.6.210.0050.04017.33
5.6.200.0020.03217.73
5.6.190.0030.02517.62
5.6.180.0070.02217.64
5.6.170.0060.02017.71
5.6.160.0060.03317.56
5.6.150.0070.02517.47
5.6.140.0050.02717.60
5.6.130.0090.02217.67
5.6.120.0090.02217.56
5.6.110.0100.02717.72
5.6.100.0050.03517.70
5.6.90.0020.05217.64
5.6.80.0070.03317.39
5.6.70.0090.02617.33
5.6.60.0060.04317.32
5.6.50.0100.02617.46
5.6.40.0000.05217.27
5.6.30.0070.03817.44
5.6.20.0070.04517.22
5.6.10.0030.04617.37
5.6.00.0140.03917.35
5.5.380.0040.02215.79
5.5.370.0030.04015.77
5.5.360.0030.02315.80
5.5.350.0060.03415.91
5.5.340.0050.02316.04
5.5.330.0000.02716.24
5.5.320.0060.02516.07
5.5.310.0090.02016.04
5.5.300.0060.02115.90
5.5.290.0060.01816.03
5.5.280.0050.01715.97
5.5.270.0050.04916.07
5.5.260.0020.04316.03
5.5.250.0050.03515.90
5.5.240.0040.02215.70
5.5.230.0090.03915.69
5.5.220.0110.03515.71
5.5.210.0030.03215.43
5.5.200.0080.03315.61
5.5.190.0060.02415.66
5.5.180.0110.02015.74
5.5.170.0030.00611.12
5.5.160.0050.04315.76
5.5.150.0060.03615.68
5.5.140.0070.03715.87
5.5.130.0100.01515.68
5.5.120.0100.03215.67
5.5.110.0100.03515.64
5.5.100.0070.03915.54
5.5.90.0060.04215.59
5.5.80.0030.03915.53
5.5.70.0050.02215.56
5.5.60.0060.03815.56
5.5.50.0030.02315.37
5.5.40.0050.04315.55
5.5.30.0000.04815.37
5.5.20.0040.02315.45
5.5.10.0090.03715.39
5.5.00.0030.04315.60
5.4.450.0050.02515.12
5.4.440.0030.02415.19
5.4.430.0030.03715.18
5.4.420.0100.03815.13
5.4.410.0060.02515.14
5.4.400.0060.03915.03
5.4.390.0080.03315.11
5.4.380.0020.03215.01
5.4.370.0030.02314.95
5.4.360.0080.03814.83
5.4.350.0090.03014.98
5.4.340.0080.02714.94
5.4.330.0070.00310.70
5.4.320.0030.04615.11
5.4.310.0080.02314.88
5.4.300.0050.03915.09
5.4.290.0050.04615.15
5.4.280.0050.03915.07
5.4.270.0030.02315.07
5.4.260.0080.03715.09
5.4.250.0120.03515.10
5.4.240.0060.03915.10
5.4.230.0080.02015.08
5.4.220.0050.03515.01
5.4.210.0070.04015.16
5.4.200.0080.03914.97
5.4.190.0080.02015.01
5.4.180.0080.03814.99
5.4.170.0050.02314.98
5.4.160.0050.02814.97
5.4.150.0030.02314.87
5.4.140.0020.04213.56
5.4.130.0110.03313.67
5.4.120.0020.02413.64
5.4.110.0050.02813.79
5.4.100.0020.02413.62
5.4.90.0030.02213.89
5.4.80.0020.03413.81
5.4.70.0050.04213.72
5.4.60.0090.01513.65
5.4.50.0020.02713.73
5.4.40.0080.02913.61
5.4.30.0030.02313.65
5.4.20.0020.04213.77
5.4.10.0000.03813.79
5.4.00.0070.02513.53
5.3.290.0070.03912.71
5.3.280.0040.03812.53
5.3.270.0010.02412.56
5.3.260.0070.03712.52
5.3.250.0050.03812.66
5.3.240.0040.03012.54
5.3.230.0060.04012.64
5.3.220.0050.03912.48
5.3.210.0060.03812.54
5.3.200.0050.03012.60
5.3.190.0070.03012.44
5.3.180.0010.02112.61
5.3.170.0050.03912.65
5.3.160.0020.04712.53
5.3.150.0020.04012.68
5.3.140.0050.04312.50
5.3.130.0060.03612.71
5.3.120.0030.04512.47
5.3.110.0020.04412.64
5.3.100.0080.02512.39
5.3.90.0050.03512.39
5.3.80.0050.02012.21
5.3.70.0050.03512.24
5.3.60.0070.03712.35
5.3.50.0030.04012.23
5.3.40.0020.04112.34
5.3.30.0050.02712.07
5.3.20.0050.02712.13
5.3.10.0050.03712.02
5.3.00.0050.03512.06
5.2.170.0040.02910.31
5.2.160.0070.03010.45
5.2.150.0050.03010.40
5.2.140.0020.03910.31
5.2.130.0050.03210.38
5.2.120.0000.02510.27
5.2.110.0000.03910.29
5.2.100.0040.02010.29
5.2.90.0070.02510.37
5.2.80.0070.02810.39
5.2.70.0050.03310.36
5.2.60.0040.02410.31
5.2.50.0030.03110.18
5.2.40.0070.03010.05
5.2.30.0040.03310.02
5.2.20.0070.03010.10
5.2.10.0050.02310.14
5.2.00.0090.0299.98
5.1.60.0050.0229.18
5.1.50.0020.0309.31
5.1.40.0030.0189.38
5.1.30.0050.0239.52
5.1.20.0000.0329.51
5.1.10.0010.0169.30
5.1.00.0080.0259.26
5.0.50.0020.0259.06
5.0.40.0040.0259.06
5.0.30.0010.0219.06
5.0.20.0030.0129.06
5.0.10.0050.0089.06
5.0.00.0070.0289.06
4.4.90.0020.0209.06
4.4.80.0000.0199.06
4.4.70.0000.0209.06
4.4.60.0030.0209.06
4.4.50.0070.0089.06
4.4.40.0000.0269.06
4.4.30.0050.0159.06
4.4.20.0030.0159.06
4.4.10.0050.0189.06
4.4.00.0030.0309.06
4.3.110.0030.0209.06
4.3.100.0020.0209.06
4.3.90.0040.0129.06
4.3.80.0050.0259.06
4.3.70.0020.0189.06
4.3.60.0020.0159.06
4.3.50.0020.0159.06
4.3.40.0030.0259.06
4.3.30.0000.0239.06
4.3.20.0020.0159.06
4.3.10.0020.0189.06
4.3.00.0050.0159.06

preferences:
44.8 ms | 401 KiB | 5 Q