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) { var_dump($offset); if (empty($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } return 'abc'; } public function offsetExists($offset) { return isset($this->container[$offset]); } public function offsetUnset($offset) { unset($this->container[$offset]); } public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $obj = new obj; $obj[] = 'Append 1'; print_r($obj);

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.0130.00618.53
8.3.50.0150.00321.14
8.3.40.0070.00718.75
8.3.30.0040.01220.29
8.3.20.0050.00320.39
8.3.10.0040.00421.95
8.3.00.0080.00022.39
8.2.180.0150.00018.13
8.2.170.0120.00322.96
8.2.160.0130.00321.91
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0050.00326.16
8.2.120.0040.00421.03
8.2.110.0060.00319.29
8.2.100.0080.00317.91
8.2.90.0100.00019.35
8.2.80.0000.00817.97
8.2.70.0070.00317.63
8.2.60.0040.00418.04
8.2.50.0050.00318.07
8.2.40.0040.00418.34
8.2.30.0050.00219.32
8.2.20.0040.00417.63
8.2.10.0040.00417.82
8.2.00.0060.00317.73
8.1.280.0140.00325.92
8.1.270.0040.00423.99
8.1.260.0110.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00321.43
8.1.230.0070.00417.52
8.1.220.0040.00417.75
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0030.00518.59
8.1.160.0000.01018.95
8.1.150.0040.00418.59
8.1.140.0000.00717.38
8.1.130.0070.00017.74
8.1.120.0040.00417.52
8.1.110.0000.00717.46
8.1.100.0000.00717.52
8.1.90.0040.00417.35
8.1.80.0030.00517.47
8.1.70.0030.00317.38
8.1.60.0040.00417.59
8.1.50.0080.00017.47
8.1.40.0080.00317.54
8.1.30.0000.00817.67
8.1.20.0060.00317.55
8.1.10.0050.00317.43
8.1.00.0000.00817.34
8.0.300.0000.00718.77
8.0.290.0000.00916.63
8.0.280.0030.00318.50
8.0.270.0000.00817.32
8.0.260.0000.00616.70
8.0.250.0030.00316.94
8.0.240.0050.00316.88
8.0.230.0040.00416.84
8.0.220.0070.00016.95
8.0.210.0050.00216.94
8.0.200.0030.00316.87
8.0.190.0040.00416.96
8.0.180.0030.00316.82
8.0.170.0040.00416.91
8.0.160.0020.00516.76
8.0.150.0060.00316.86
8.0.140.0060.00316.87
8.0.130.0050.00013.34
8.0.120.0040.00416.75
8.0.110.0030.00516.84
8.0.100.0070.00016.72
8.0.90.0040.00416.89
8.0.80.0100.01016.87
8.0.70.0070.00016.96
8.0.60.0050.00216.84
8.0.50.0000.00716.88
8.0.30.0160.00617.10
8.0.20.0130.00617.40
8.0.10.0000.00716.89
8.0.00.0130.00716.80
7.4.330.0000.00516.72
7.4.320.0040.00416.63
7.4.300.0000.00716.52
7.4.290.0000.00716.50
7.4.280.0070.00016.61
7.4.270.0070.00016.44
7.4.260.0080.00013.18
7.4.250.0040.00416.41
7.4.240.0020.00616.52
7.4.230.0030.00516.61
7.4.220.0120.00616.58
7.4.210.0050.00916.53
7.4.200.0000.00716.49
7.4.190.0000.00716.32
7.4.160.0060.01016.52
7.4.150.0140.00317.40
7.4.140.0100.00617.86
7.4.130.0070.00916.56
7.4.120.0090.00816.48
7.4.110.0030.01416.56
7.4.100.0090.00916.44
7.4.90.0080.00816.63
7.4.80.0110.00719.39
7.4.70.0120.00616.64
7.4.60.0060.00916.56
7.4.50.0040.00416.46
7.4.40.0060.00522.77
7.4.30.0030.01316.61
7.4.00.0040.01114.89
7.3.330.0000.00513.26
7.3.320.0000.00613.11
7.3.310.0000.00616.34
7.3.300.0000.00716.32
7.3.290.0030.01016.32
7.3.280.0110.00616.32
7.3.270.0000.01717.40
7.3.260.0070.01116.54
7.3.250.0090.00816.39
7.3.240.0100.00616.43
7.3.230.0110.00616.39
7.3.210.0120.00616.48
7.3.200.0100.00719.39
7.3.190.0030.01316.59
7.3.180.0120.00916.52
7.3.170.0060.01016.45
7.3.160.0030.01316.32
7.3.120.0060.01014.92
7.3.110.0040.01114.82
7.3.100.0100.00314.80
7.3.90.0040.01414.86
7.3.80.0100.00714.84
7.3.70.0030.01314.84
7.3.60.0060.00714.95
7.3.50.0070.00314.78
7.3.40.0070.00714.53
7.3.30.0000.01414.54
7.3.20.0030.01416.73
7.3.10.0040.00816.54
7.3.00.0060.00916.70
7.2.330.0060.01316.86
7.2.320.0150.00316.71
7.2.310.0070.01016.47
7.2.300.0060.01216.51
7.2.290.0080.00816.83
7.2.240.0100.00715.24
7.2.230.0040.01114.98
7.2.220.0070.00715.13
7.2.210.0140.00315.20
7.2.200.0080.00315.04
7.2.190.0060.01015.13
7.2.180.0040.01115.12
7.2.170.0000.01214.91
7.2.160.0000.01415.15
7.2.150.0030.00616.91
7.2.140.0060.00917.07
7.2.130.0000.01617.00
7.2.120.0000.01317.02
7.2.110.0070.00716.92
7.2.100.0040.01116.77
7.2.90.0070.01017.20
7.2.80.0030.01016.68
7.2.70.0070.01016.85
7.2.60.0040.00717.09
7.2.50.0040.01216.99
7.2.40.0090.00617.14
7.2.30.0090.00917.14
7.2.20.0030.01016.95
7.2.10.0100.00616.63
7.2.00.0050.01118.21
7.1.330.0040.01415.75
7.1.320.0060.00615.88
7.1.310.0060.00315.56
7.1.300.0070.00715.84
7.1.290.0030.01015.60
7.1.280.0090.00015.46
7.1.270.0030.01015.79
7.1.260.0030.00715.68
7.1.250.0090.00615.64
7.1.100.0030.01017.95
7.1.70.0070.00316.86
7.1.60.0100.01619.17
7.1.50.0160.00317.04
7.1.00.0070.05022.28
7.0.200.0040.00416.91
7.0.140.0030.07322.00
7.0.100.0070.08719.89
7.0.90.0030.07720.08
7.0.80.0070.06319.82
7.0.70.0030.08019.86
7.0.60.0200.07019.91
7.0.50.0070.08320.21
7.0.40.0230.03320.00
7.0.30.0070.06020.04
7.0.20.0070.04020.02
7.0.10.0100.06320.07
7.0.00.0000.04720.00
5.6.280.0070.07021.03
5.6.250.0070.08320.55
5.6.240.0070.08020.59
5.6.230.0070.05320.56
5.6.220.0100.07720.58
5.6.210.0000.04720.57
5.6.200.0170.07721.05
5.6.190.0100.08021.04
5.6.180.0170.04720.91
5.6.170.0030.08321.04
5.6.160.0130.07020.98
5.6.150.0070.06720.91
5.6.140.0100.07321.00
5.6.130.0100.03720.92
5.6.120.0070.07320.98
5.6.110.0070.05320.96
5.6.100.0100.08320.99
5.6.90.0100.07321.05
5.6.80.0070.04720.43
5.6.70.0100.03720.45
5.6.60.0170.02720.45
5.6.50.0100.03320.45
5.6.40.0100.03320.40
5.6.30.0130.04320.43
5.6.20.0070.03720.25
5.6.10.0030.04020.33
5.6.00.0000.04320.40
5.5.380.0130.07320.40
5.5.370.0170.04020.32
5.5.360.0130.07720.45
5.5.350.0030.08020.38
5.5.340.0230.06720.59
5.5.330.0100.08320.73
5.5.320.0130.06720.86
5.5.310.0170.07720.75
5.5.300.0070.04020.76
5.5.290.0030.08320.69
5.5.280.0000.07020.86
5.5.270.0030.04720.71
5.5.260.0130.06020.59
5.5.250.0130.07320.66
5.5.240.0030.04020.23
5.5.230.0100.04020.14
5.5.220.0030.04020.07
5.5.210.0030.04020.11
5.5.200.0030.04020.20
5.5.190.0070.03720.09
5.5.180.0000.04320.11
5.5.160.0070.03320.18
5.5.150.0030.06719.95
5.5.140.0000.04320.21
5.5.130.0070.03720.21
5.5.120.0030.04020.09
5.5.110.0000.04319.93
5.5.100.0000.04319.94
5.5.90.0030.04020.11
5.5.80.0100.03320.12
5.5.70.0030.04020.05
5.5.60.0030.04019.87
5.5.50.0070.03720.05
5.5.40.0070.03719.96
5.5.30.0070.03719.89
5.5.20.0070.03019.91
5.5.10.0030.04020.00
5.5.00.0000.04320.06
5.4.450.0100.04019.38
5.4.440.0030.07019.46
5.4.430.0030.08019.45
5.4.420.0100.07019.36
5.4.410.0100.07019.36
5.4.400.0030.04019.13
5.4.390.0070.03719.09
5.4.380.0030.03718.86
5.4.370.0130.02718.90
5.4.360.0070.03719.04
5.4.350.0070.03719.15
5.4.340.0030.06019.04
5.4.320.0000.08719.02
5.4.310.0100.03319.22
5.4.300.0030.03719.04
5.4.290.0070.03319.13
5.4.280.0100.04719.18
5.4.270.0070.03319.13
5.4.260.0130.03018.88
5.4.250.0030.03719.08
5.4.240.0030.04019.04
5.4.230.0030.03718.87
5.4.220.0030.04018.89
5.4.210.0070.04019.12
5.4.200.0100.03319.05
5.4.190.0070.03319.20
5.4.180.0070.04019.17
5.4.170.0070.03719.10
5.4.160.0030.03719.02
5.4.150.0030.03018.82
5.4.140.0000.04016.29
5.4.130.0070.03316.41
5.4.120.0030.03716.37
5.4.110.0000.06316.43
5.4.100.0170.06016.32
5.4.90.0070.07016.32
5.4.80.0000.06016.33
5.4.70.0130.06716.50
5.4.60.0030.07316.52
5.4.50.0100.07016.48
5.4.40.0100.05716.51
5.4.30.0000.04016.33
5.4.20.0030.07716.31
5.4.10.0130.06316.26
5.4.00.0070.04015.89
5.3.290.0030.04314.65
5.3.280.0070.03314.66
5.3.270.0070.03314.74
5.3.260.0030.03014.72
5.3.250.0130.02014.56
5.3.240.0030.03314.68
5.3.230.0070.03314.67
5.3.220.0070.02714.67
5.3.210.0130.06014.59
5.3.200.0000.05714.53
5.3.190.0070.07014.71
5.3.180.0030.03714.58
5.3.170.0030.08314.56
5.3.160.0100.05314.52
5.3.150.0070.07014.59
5.3.140.0100.06714.52
5.3.130.0130.05014.70
5.3.120.0100.06314.51
5.3.110.0070.07714.59
5.3.100.0070.04014.06
5.3.90.0100.07714.14
5.3.80.0100.06014.15
5.3.70.0100.07314.05
5.3.60.0070.07014.00
5.3.50.0070.07713.96
5.3.40.0000.07713.88
5.3.30.0100.06714.01
5.3.20.0070.07313.82
5.3.10.0100.07313.68
5.3.00.0000.07313.65
5.2.170.0000.03711.09
5.2.160.0000.06311.04
5.2.150.0070.06011.22
5.2.140.0070.06011.07
5.2.130.0230.01711.10
5.2.120.0100.05710.98
5.2.110.0070.05311.18
5.2.100.0070.06011.02
5.2.90.0030.05711.03
5.2.80.0070.06010.99
5.2.70.0100.04311.23
5.2.60.0070.06311.13
5.2.50.0100.06011.12
5.2.40.0100.05311.06
5.2.30.0030.06011.12
5.2.20.0000.06311.11
5.2.10.0030.06011.01
5.2.00.0030.05010.64
5.1.60.0070.05010.10
5.1.50.0070.05710.06
5.1.40.0070.0409.98
5.1.30.0030.03310.36
5.1.20.0070.05310.27
5.1.10.0070.02710.16
5.1.00.0070.03010.17
5.0.50.0000.0308.71
5.0.40.0030.0438.71
5.0.30.0070.0638.71
5.0.20.0070.0378.71
5.0.10.0000.0478.71
5.0.00.0030.0678.71
4.4.90.0030.0338.71
4.4.80.0070.0178.71
4.4.70.0030.0338.71
4.4.60.0000.0238.71
4.4.50.0070.0308.71
4.4.40.0000.0378.71
4.4.30.0100.0308.71
4.4.20.0030.0378.71
4.4.10.0000.0378.71
4.4.00.0000.0508.71
4.3.110.0030.0338.71
4.3.100.0070.0208.71
4.3.90.0000.0378.71
4.3.80.0000.0378.71
4.3.70.0000.0378.71
4.3.60.0000.0378.71
4.3.50.0100.0278.71
4.3.40.0030.0278.71
4.3.30.0030.0338.71
4.3.20.0030.0338.71
4.3.10.0030.0378.71
4.3.00.0000.0378.71

preferences:
41.77 ms | 401 KiB | 5 Q