3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); 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) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $obj = new obj; var_dump(isset($obj["two"])); var_dump($obj["two"]); unset($obj["two"]); var_dump(isset($obj["two"])); $obj["two"] = "A value"; var_dump($obj["two"]); $obj[] = 'Append 1'; $obj[] = 'Append 2';

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.5.30.0090.00817.61
8.5.20.0100.00720.17
8.5.10.0060.00319.99
8.5.00.0110.01020.34
8.4.180.0080.01519.65
8.4.170.0180.00421.95
8.4.160.0080.01222.17
8.4.150.0010.00114.05
8.4.140.0120.00817.68
8.4.130.0120.00818.83
8.4.120.0120.00819.70
8.4.110.0090.01217.82
8.4.100.0140.00617.86
8.4.90.0060.00320.67
8.4.80.0130.00618.99
8.4.70.0130.00818.86
8.4.60.0100.01020.53
8.4.50.0130.00818.82
8.4.40.0110.00820.27
8.4.30.0100.01017.87
8.4.20.0210.00017.64
8.4.10.0100.01017.49
8.3.300.0110.01218.62
8.3.290.0130.00720.62
8.3.280.0170.00518.50
8.3.270.0120.00716.85
8.3.260.0120.00716.66
8.3.250.0040.00716.77
8.3.240.0120.00716.98
8.3.230.0130.00616.89
8.3.220.0040.00418.82
8.3.210.0150.00416.86
8.3.200.0090.01016.73
8.3.190.0040.00617.14
8.3.180.0050.00519.14
8.3.170.0140.00417.16
8.3.160.0050.00318.38
8.3.150.0030.00516.79
8.3.140.0090.00020.80
8.3.130.0030.00618.52
8.3.120.0000.01018.99
8.3.110.0030.00620.94
8.3.100.0000.00924.06
8.3.90.0080.00026.77
8.3.80.0090.00018.40
8.3.70.0120.00618.30
8.3.60.0130.00616.63
8.3.50.0090.01021.20
8.3.40.0120.00318.96
8.3.30.0070.01118.84
8.3.20.0110.00018.82
8.3.10.0040.00421.85
8.3.00.0040.00420.95
8.2.300.0120.00922.24
8.2.290.0130.00716.54
8.2.280.0120.00818.16
8.2.270.0100.01017.03
8.2.260.0080.00016.98
8.2.250.0120.00416.29
8.2.240.0110.00417.04
8.2.230.0030.00622.58
8.2.220.0060.00337.54
8.2.210.0120.00326.77
8.2.200.0030.00618.66
8.2.190.0060.00916.58
8.2.180.0090.00616.36
8.2.170.0140.00722.96
8.2.160.0070.00719.02
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00422.27
8.2.120.0030.00626.35
8.2.110.0120.00019.45
8.2.100.0120.00018.16
8.2.90.0060.00319.30
8.2.80.0030.00617.97
8.2.70.0030.00617.63
8.2.60.0000.00817.93
8.2.50.0060.00318.10
8.2.40.0040.00420.59
8.2.30.0040.00420.68
8.2.20.0000.00817.80
8.2.10.0070.00018.07
8.2.00.0000.00818.01
8.1.340.0130.00919.76
8.1.330.0120.00816.34
8.1.320.0090.00916.05
8.1.310.0070.01118.40
8.1.300.0110.00416.42
8.1.290.0090.00330.84
8.1.280.0070.00725.92
8.1.270.0040.00423.79
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0090.00022.68
8.1.230.0080.00417.52
8.1.220.0000.00817.74
8.1.210.0100.00018.77
8.1.200.0040.00417.35
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0040.00418.48
8.1.160.0050.00320.90
8.1.150.0000.00818.83
8.1.140.0000.00719.57
8.1.130.0070.00017.64
8.1.120.0030.00517.49
8.1.110.0030.00517.37
8.1.100.0070.00017.53
8.1.90.0040.00417.48
8.1.80.0080.00017.50
8.1.70.0050.00317.49
8.1.60.0030.00617.61
8.1.50.0090.00017.50
8.1.40.0050.00317.58
8.1.30.0040.00417.71
8.1.20.0040.00417.65
8.1.10.0040.00417.32
8.1.00.0000.00817.43
8.0.300.0030.00618.77
8.0.290.0030.00616.75
8.0.280.0040.00418.37
8.0.270.0030.00317.28
8.0.260.0030.00317.32
8.0.250.0070.00016.93
8.0.240.0000.00816.98
8.0.230.0060.00316.94
8.0.220.0000.00716.82
8.0.210.0030.00316.91
8.0.200.0030.00316.88
8.0.190.0000.00716.84
8.0.180.0000.00716.97
8.0.170.0050.00316.85
8.0.160.0040.00416.98
8.0.150.0030.00616.75
8.0.140.0030.00316.87
8.0.130.0030.00313.38
8.0.120.0030.00516.84
8.0.110.0000.00816.88
8.0.100.0040.00417.01
8.0.90.0040.00416.87
8.0.80.0060.00916.95
8.0.70.0040.00416.79
8.0.60.0000.00816.76
8.0.50.0000.00716.68
8.0.30.0070.01217.23
8.0.20.0120.01017.40
8.0.10.0050.00217.02
8.0.00.0100.00916.76
7.4.330.0020.00215.08
7.4.320.0030.00316.42
7.4.300.0040.00416.64
7.4.290.0000.00716.62
7.4.280.0040.00416.60
7.4.270.0030.00316.63
7.4.260.0070.00016.52
7.4.250.0000.00716.34
7.4.240.0030.00416.55
7.4.230.0030.00316.56
7.4.220.0080.01116.44
7.4.210.0140.00316.56
7.4.200.0000.00716.64
7.4.160.0080.00816.66
7.4.150.0110.00817.40
7.4.140.0140.00517.86
7.4.130.0110.00816.50
7.4.120.0090.00916.46
7.4.110.0120.00616.55
7.4.100.0060.01216.54
7.4.90.0060.01216.55
7.4.80.0100.00719.39
7.4.70.0100.00716.44
7.4.60.0120.00616.62
7.4.50.0100.00716.23
7.4.40.0110.00616.45
7.4.30.0130.01016.58
7.4.00.0060.01115.10
7.3.330.0050.00013.21
7.3.320.0000.00513.37
7.3.310.0000.00716.46
7.3.300.0000.00716.29
7.3.290.0090.00616.37
7.3.280.0060.01116.39
7.3.270.0140.00317.40
7.3.260.0110.00716.56
7.3.250.0110.00816.48
7.3.240.0080.01016.41
7.3.230.0090.01216.68
7.3.210.0130.00316.50
7.3.200.0030.01316.51
7.3.190.0180.00016.29
7.3.180.0030.01316.18
7.3.170.0150.00616.58
7.3.160.0090.01216.36
7.3.120.0080.00814.95
7.3.110.0060.01214.99
7.3.100.0000.01714.46
7.3.90.0080.00814.74
7.3.80.0000.01114.99
7.3.70.0070.00714.73
7.3.60.0040.00714.79
7.3.50.0060.00614.47
7.3.40.0070.00314.91
7.3.30.0120.00314.90
7.3.20.0000.01016.50
7.3.10.0100.01016.51
7.3.00.0060.01216.60
7.2.330.0070.01116.82
7.2.320.0180.00316.64
7.2.310.0060.01216.70
7.2.300.0080.00816.72
7.2.290.0140.01116.54
7.2.250.0070.01415.04
7.2.240.0000.01915.12
7.2.230.0060.00314.96
7.2.220.0040.01214.92
7.2.210.0040.01215.33
7.2.200.0000.01514.95
7.2.190.0040.00715.02
7.2.180.0130.00315.04
7.2.170.0060.00915.11
7.2.130.0190.00616.48
7.2.120.0230.00716.43
7.2.110.0160.00316.55
7.2.100.0150.00616.41
7.2.90.0120.00816.70
7.2.80.0130.00616.41
7.2.70.0110.01417.07
7.2.60.0180.01117.02
7.2.50.0160.00316.73
7.2.40.0170.00416.92
7.2.30.0110.00617.06
7.2.20.0120.00617.19
7.2.10.0070.00717.00
7.2.00.0090.00616.78
7.1.330.0030.01015.86
7.1.320.0090.00015.75
7.1.310.0060.00915.71
7.1.300.0080.00815.84
7.1.290.0060.00315.72
7.1.280.0030.01315.84
7.1.270.0070.00315.80
7.1.260.0100.00315.84
7.1.250.0150.00315.36
7.1.200.0060.00915.58
7.1.70.0040.00417.20
7.1.60.0100.01320.41
7.1.00.0100.07022.44
7.0.200.0150.00414.80
7.0.60.0000.04721.76
7.0.50.0030.05017.88
7.0.40.0170.06320.11
7.0.30.0100.06320.09
7.0.20.0230.05720.08
7.0.10.0170.06020.28
7.0.00.0270.05020.18
5.6.280.0070.07021.12
5.6.210.0000.07320.51
5.6.200.0070.08318.14
5.6.190.0270.05320.63
5.6.180.0100.06720.63
5.6.170.0200.06020.70
5.6.160.0200.05720.77
5.6.150.0070.06320.35
5.6.140.0170.05720.41
5.6.130.0170.06020.44
5.6.120.0100.06020.41
5.6.110.0130.05320.38
5.6.100.0270.05320.40
5.6.90.0430.06020.39
5.6.80.0270.06319.80
5.6.70.0270.06319.81
5.6.60.0270.05019.73
5.6.50.0100.05319.71
5.6.40.0470.05719.69
5.6.30.0530.05019.71
5.6.20.0400.05019.75
5.6.10.0130.05319.79
5.6.00.0230.05719.70
5.5.350.0230.04720.36
5.5.340.0100.04317.97
5.5.330.0100.06320.27
5.5.320.0030.06720.40
5.5.310.0100.06020.27
5.5.300.0200.06020.38
5.5.290.0230.06020.21
5.5.280.0070.06020.15
5.5.270.0200.04720.16
5.5.260.0430.06020.06
5.5.250.0500.05320.02
5.5.240.0400.05319.41
5.5.230.0230.06719.59
5.5.220.0430.05019.57
5.5.210.0100.05719.38
5.5.200.0370.06019.52
5.5.190.0430.05019.57
5.5.180.0470.04719.55
5.5.160.0370.06019.45
5.5.150.0300.05719.56
5.5.140.0100.06019.53
5.5.130.0330.04019.56
5.5.120.0200.06319.54
5.5.110.0130.06019.45
5.5.100.0130.06019.41
5.5.90.0100.06719.35
5.5.80.0270.06719.32
5.5.70.0130.06319.41
5.5.60.0170.07319.48
5.5.50.0300.06319.26
5.5.40.0270.05719.46
5.5.30.0170.06019.41
5.5.20.0200.06019.38
5.5.10.0300.05019.46
5.5.00.0430.05719.37

preferences:
160.61 ms | 403 KiB | 5 Q