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; } } 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.40.0040.01118.80
8.3.30.0110.00420.35
8.3.20.0080.00020.35
8.3.10.0080.00022.05
8.3.00.0040.00422.44
8.2.170.0140.00322.96
8.2.160.0000.01522.17
8.2.150.0060.00324.18
8.2.140.0090.00024.66
8.2.130.0030.00526.16
8.2.120.0070.00020.82
8.2.110.0090.00022.25
8.2.100.0080.00419.45
8.2.90.0040.00419.17
8.2.80.0080.00019.38
8.2.70.0060.00317.38
8.2.60.0050.00317.78
8.2.50.0090.00018.07
8.2.40.0000.01018.21
8.2.30.0000.00819.51
8.2.20.0080.00017.75
8.2.10.0050.00317.75
8.2.00.0040.00717.68
8.1.270.0080.00023.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00620.64
8.1.230.0090.00317.57
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0050.00517.23
8.1.190.0000.00917.66
8.1.180.0080.00018.10
8.1.170.0080.00018.59
8.1.160.0050.00518.95
8.1.150.0000.00818.64
8.1.140.0040.00417.47
8.1.130.0040.00417.93
8.1.120.0070.00017.53
8.1.110.0080.00017.45
8.1.100.0000.00717.43
8.1.90.0000.00717.47
8.1.80.0040.00417.38
8.1.70.0030.00317.34
8.1.60.0040.00417.56
8.1.50.0000.00717.41
8.1.40.0030.00617.43
8.1.30.0040.00417.57
8.1.20.0040.00417.57
8.1.10.0030.00517.41
8.1.00.0040.00417.45
8.0.300.0050.00318.77
8.0.290.0040.00417.05
8.0.280.0030.00318.41
8.0.270.0040.00417.18
8.0.260.0000.00616.67
8.0.250.0070.00016.87
8.0.240.0060.00316.89
8.0.230.0000.00716.98
8.0.220.0070.00016.91
8.0.210.0080.00016.88
8.0.200.0040.00417.00
8.0.190.0000.00717.00
8.0.180.0000.00716.93
8.0.170.0030.00516.87
8.0.160.0050.00316.79
8.0.150.0080.00016.80
8.0.140.0030.00716.88
8.0.130.0000.00613.36
8.0.120.0040.00416.89
8.0.110.0040.00416.98
8.0.100.0070.00016.89
8.0.90.0020.00516.96
8.0.80.0130.00716.95
8.0.70.0000.00716.69
8.0.60.0000.00716.93
8.0.50.0080.00016.79
8.0.30.0070.01417.05
8.0.20.0100.00917.40
8.0.10.0080.00016.80
8.0.00.0100.01016.75
7.4.330.0020.00216.83
7.4.320.0000.00616.53
7.4.300.0070.00016.61
7.4.290.0070.00016.46
7.4.280.0000.00716.64
7.4.270.0030.00316.47
7.4.260.0050.00013.18
7.4.250.0070.00016.47
7.4.240.0030.00416.64
7.4.230.0070.00016.54
7.4.220.0120.00616.48
7.4.210.0070.00816.56
7.4.200.0070.00016.68
7.4.190.0030.00316.65
7.4.160.0160.00016.64
7.4.150.0110.00717.40
7.4.140.0130.00517.86
7.4.130.0070.01016.71
7.4.120.0030.01316.51
7.4.110.0060.01216.65
7.4.100.0110.00816.55
7.4.90.0060.01116.52
7.4.80.0070.01119.39
7.4.70.0110.00616.34
7.4.60.0040.01116.68
7.4.50.0000.00816.30
7.4.40.0070.00722.77
7.4.30.0030.01216.52
7.4.00.0030.00914.70
7.3.330.0030.00313.30
7.3.320.0000.00613.30
7.3.310.0070.00016.12
7.3.300.0030.00316.29
7.3.290.0100.00716.29
7.3.280.0080.00816.27
7.3.270.0030.01517.40
7.3.260.0110.01116.51
7.3.250.0100.00716.50
7.3.240.0040.01216.43
7.3.230.0060.01016.52
7.3.210.0130.01016.52
7.3.200.0110.00619.39
7.3.190.0060.01216.32
7.3.180.0030.01316.46
7.3.170.0060.01116.46
7.3.160.0060.01116.52
7.3.120.0000.01414.97
7.3.10.0020.01216.72
7.3.00.0070.00716.50
7.2.330.0090.00916.66
7.2.320.0040.01416.77
7.2.310.0120.00616.55
7.2.300.0090.00716.51
7.2.290.0060.01016.81
7.2.130.0030.00916.97
7.2.120.0080.00616.84
7.2.110.0060.00716.89
7.2.100.0060.00616.97
7.2.90.0030.00816.99
7.2.80.0020.01317.06
7.2.70.0040.00616.96
7.2.60.0080.00616.83
7.2.50.0030.00816.95
7.2.40.0070.00317.03
7.2.30.0040.00817.05
7.2.20.0100.00716.97
7.2.10.0050.00517.00
7.2.00.0090.00417.06
7.1.250.0050.00515.83
7.1.70.0030.00516.92
7.1.60.0110.01419.17
7.1.50.0070.01416.58
7.1.00.0070.07022.27
7.0.200.0000.00816.80
7.0.140.0100.07021.94
7.0.80.0100.06721.76
7.0.70.0070.07721.80
7.0.60.0130.07021.68
7.0.50.0100.05722.09
7.0.40.0130.07719.95
7.0.30.0200.06020.16
7.0.20.0100.08320.13
7.0.10.0070.05320.04
7.0.00.0030.07320.11
5.6.230.0130.06020.64
5.6.220.0070.09320.75
5.6.210.0030.07720.77
5.6.200.0200.05720.96
5.6.190.0100.07321.00
5.6.180.0000.08021.18
5.6.170.0030.06021.09
5.6.160.0070.06721.03
5.6.150.0170.06321.09
5.6.140.0000.04721.05
5.6.130.0100.04321.09
5.6.120.0100.08721.03
5.6.110.0170.07720.93
5.6.100.0030.04321.08
5.6.90.0130.07021.16
5.6.80.0100.07020.34
5.6.70.0230.04720.32
5.6.60.0130.07320.37
5.6.50.0130.07320.46
5.6.40.0130.07320.30
5.6.30.0070.07720.33
5.6.20.0100.07720.37
5.6.10.0130.06320.43
5.6.00.0070.07720.48
5.5.370.0070.08020.44
5.5.360.0030.06720.35
5.5.350.0030.08320.47
5.5.340.0070.07720.94
5.5.330.0130.05020.92
5.5.320.0100.07320.87
5.5.310.0030.04720.92
5.5.300.0100.03720.88
5.5.290.0070.06320.88
5.5.280.0230.06720.81
5.5.270.0100.04720.79
5.5.260.0070.08320.79
5.5.250.0070.06320.69
5.5.240.0170.05320.32
5.5.230.0100.07720.26
5.5.220.0070.08020.21
5.5.210.0200.06720.25
5.5.200.0130.07320.13
5.5.190.0030.07320.29
5.5.180.0070.06320.23
5.5.160.0000.05320.15
5.5.150.0100.04020.11
5.5.140.0100.07719.99
5.5.130.0130.05720.18
5.5.120.0030.05020.27
5.5.110.0130.07720.15
5.5.100.0100.04720.18
5.5.90.0100.04720.11
5.5.80.0030.07720.10
5.5.70.0100.07020.11
5.5.60.0000.05320.07
5.5.50.0100.05020.16
5.5.40.0070.07720.16
5.5.30.0070.07720.01
5.5.20.0030.07020.03
5.5.10.0170.07020.11
5.5.00.0070.07720.11
5.4.450.0100.05719.36
5.4.440.0100.07019.45
5.4.430.0070.04319.42
5.4.420.0070.08019.53
5.4.410.0170.06319.40
5.4.400.0070.06718.85
5.4.390.0030.07019.07
5.4.380.0030.06319.04
5.4.370.0070.07319.12
5.4.360.0000.07719.20
5.4.350.0100.08018.85
5.4.340.0100.05319.18
5.4.320.0100.07318.95
5.4.310.0100.06319.18
5.4.300.0070.04319.12
5.4.290.0100.07018.95
5.4.280.0070.07718.89
5.4.270.0100.07318.91
5.4.260.0130.06319.08
5.4.250.0130.07319.04
5.4.240.0030.06719.20
5.4.230.0170.07019.02
5.4.220.0030.04318.89
5.4.210.0070.05319.11
5.4.200.0100.07019.16
5.4.190.0070.07719.04
5.4.180.0070.05319.11
5.4.170.0070.04019.17
5.4.160.0030.05718.93
5.4.150.0030.05319.16
5.4.140.0000.03716.35
5.4.130.0070.07716.41
5.4.120.0070.07016.19
5.4.110.0070.06716.36
5.4.100.0000.08316.48
5.4.90.0030.06716.39
5.4.80.0130.05316.34
5.4.70.0030.07316.47
5.4.60.0130.04316.48
5.4.50.0130.06316.41
5.4.40.0030.04016.46
5.4.30.0070.04716.46
5.4.20.0070.04316.24
5.4.10.0000.07716.39
5.4.00.0070.05015.86
5.3.290.0100.05014.73
5.3.280.0070.05714.61
5.3.270.0030.04314.68
5.3.260.0070.04714.58
5.3.250.0100.07014.67
5.3.240.0000.05014.70
5.3.230.0070.05014.63
5.3.220.0070.03714.54
5.3.210.0030.04314.68
5.3.200.0100.07014.57
5.3.190.0030.04014.54
5.3.180.0100.06314.57
5.3.170.0070.05314.67
5.3.160.0000.07014.56
5.3.150.0070.06714.71
5.3.140.0100.04314.57
5.3.130.0070.04014.63
5.3.120.0030.07314.49
5.3.110.0030.04014.57
5.3.100.0070.08014.06
5.3.90.0030.07314.12
5.3.80.0030.07314.14
5.3.70.0030.07714.12
5.3.60.0070.06014.01
5.3.50.0070.06313.93
5.3.40.0100.05013.94
5.3.30.0070.05314.05
5.3.20.0100.05713.79
5.3.10.0030.07713.75
5.3.00.0070.07313.65
5.2.170.0070.06011.73
5.2.160.0030.06311.73
5.2.150.0070.03011.73
5.2.140.0030.06011.73
5.2.130.0070.04711.73
5.2.120.0070.04711.73
5.2.110.0100.05011.73
5.2.100.0030.05311.73
5.2.90.0030.03711.73
5.2.80.0030.06311.73
5.2.70.0100.04711.73
5.2.60.0070.04011.73
5.2.50.0030.05011.73
5.2.40.0070.05711.73
5.2.30.0030.03711.73
5.2.20.0100.05311.73
5.2.10.0030.05311.73
5.2.00.0070.06011.73
5.1.60.0030.05311.73
5.1.50.0000.06011.73
5.1.40.0000.02711.73
5.1.30.0000.05311.73
5.1.20.0030.05711.73
5.1.10.0170.04711.73
5.1.00.0030.03711.73
5.0.50.0070.02711.73
5.0.40.0000.05711.73
5.0.30.0070.06011.73
5.0.20.0030.03711.73
5.0.10.0000.03711.73
5.0.00.0030.06311.73
4.4.90.0070.03011.73
4.4.80.0030.01711.73
4.4.70.0070.02711.73
4.4.60.0000.02711.73
4.4.50.0000.03711.73
4.4.40.0000.03711.73
4.4.30.0030.02311.73
4.4.20.0000.04011.73
4.4.10.0030.02311.73
4.4.00.0000.05311.73
4.3.110.0000.03011.73
4.3.100.0000.02311.73
4.3.90.0030.01311.73
4.3.80.0000.03711.73
4.3.70.0030.03311.73
4.3.60.0030.03311.73
4.3.50.0000.03011.73
4.3.40.0030.03711.73
4.3.30.0030.01711.73
4.3.20.0000.01711.73
4.3.10.0000.01711.73
4.3.00.0030.01311.73

preferences:
44.74 ms | 400 KiB | 5 Q