3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C implements ArrayAccess { public $data = array( "foo" => null ); public function offsetExists($offset): bool { return array_key_exists((string)$offset, $this->data); } public function offsetGet($offset) { return $this->data[$offset]; } public function offsetSet($offset, $value): void { $this->data[$offset] = $value; } public function offsetUnset($offset): void { unset($this->data[$offset]); } } $o = new C(); var_dump(isset($o['foo'])); var_dump(property_exists($o, 'foo')); var_dump(array_key_exists('foo', $o)); var_dump(array_key_exists('foo', ['foo' => null]));

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.4.130.0120.00818.77
8.4.120.0130.00720.65
8.4.110.0120.00918.71
8.4.100.0110.00818.11
8.4.90.0100.00920.69
8.4.80.0110.00920.50
8.4.70.0150.00518.97
8.4.60.0100.00920.33
8.4.50.0090.00820.53
8.4.40.0090.01217.83
8.4.30.0070.00720.52
8.4.20.0100.01022.39
8.4.10.0080.00019.87
8.3.260.0030.00616.75
8.3.250.0060.01317.17
8.3.240.0120.00716.59
8.3.230.0110.00917.38
8.3.220.0050.00319.04
8.3.210.0100.00416.55
8.3.200.0060.00316.63
8.3.190.0120.00717.31
8.3.180.0100.01018.79
8.3.170.0120.00617.18
8.3.160.0090.00917.05
8.3.150.0120.00617.17
8.3.140.0040.00416.62
8.3.130.0060.00318.41
8.3.120.0060.01020.77
8.3.110.0060.00320.94
8.3.100.0080.00018.34
8.3.90.0070.00326.77
8.3.80.0050.00519.36
8.3.70.0130.00616.75
8.3.60.0040.01116.88
8.3.50.0160.00624.46
8.3.40.0080.00822.05
8.3.30.0040.01118.85
8.3.20.0040.00424.18
8.3.10.0000.00724.66
8.3.00.0040.00426.16
8.2.290.0120.00717.27
8.2.280.0090.01118.36
8.2.270.0150.00416.63
8.2.260.0090.00617.30
8.2.250.0040.00418.51
8.2.240.0150.00317.57
8.2.230.0060.00322.58
8.2.220.0040.00724.06
8.2.210.0040.00426.77
8.2.200.0060.00318.88
8.2.190.0210.00017.00
8.2.180.0110.00425.92
8.2.170.0150.00019.14
8.2.160.0030.01322.96
8.2.150.0050.00325.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00826.35
8.2.110.0040.00721.12
8.2.100.0040.00819.76
8.2.90.0000.00819.34
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0030.00618.16
8.2.30.0040.00419.91
8.2.20.0020.00518.06
8.2.10.0000.00719.21
8.2.00.0000.00719.23
8.1.330.0110.00816.05
8.1.320.0100.01116.50
8.1.310.0070.00016.79
8.1.300.0160.00317.88
8.1.290.0060.00330.84
8.1.280.0120.00925.92
8.1.270.0080.00023.99
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0030.01422.74
8.1.230.0080.00322.31
8.1.220.0030.00617.76
8.1.210.0040.00418.77
8.1.200.0030.00617.46
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0090.00018.53
8.1.160.0080.00018.99
8.1.150.0040.00418.91
8.1.140.0040.00418.90
8.1.130.0000.00720.20
8.1.120.0050.00317.38
8.1.110.0040.00417.38
8.1.100.0030.00617.48
8.1.90.0080.00017.49
8.1.80.0040.00417.48
8.1.70.0000.00717.40
8.1.60.0030.00617.56
8.1.50.0040.00417.45
8.1.40.0000.00817.52
8.1.30.0040.00417.58
8.1.20.0030.00517.56
8.1.10.0080.00017.63
8.1.00.0040.00417.51
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0030.00318.46
8.0.270.0030.00318.13
8.0.260.0070.00018.38
8.0.250.0070.00016.98
8.0.240.0030.00317.05
8.0.230.0030.00316.91
8.0.220.0070.00016.94
8.0.210.0070.00017.00
8.0.200.0000.00717.00
8.0.190.0030.00616.95
8.0.180.0000.01017.02
8.0.170.0030.00516.88
8.0.160.0070.00016.96
8.0.150.0050.00316.88
8.0.140.0040.00416.95
8.0.130.0000.00513.36
8.0.120.0000.00716.84
8.0.110.0040.00416.84
8.0.100.0040.00416.84
8.0.90.0040.00417.02
8.0.80.0060.01216.93
8.0.70.0030.00616.92
8.0.60.0000.00716.88
8.0.50.0070.00016.93
8.0.30.0070.01017.12
8.0.20.0100.01217.17
8.0.10.0040.00417.07
8.0.00.0170.00716.79
7.4.330.0050.00015.55
7.4.320.0000.00616.54
7.4.300.0000.00616.62
7.4.290.0000.00716.63
7.4.280.0000.00716.53
7.4.270.0040.00416.63
7.4.260.0000.00513.28
7.4.250.0000.00816.47
7.4.240.0000.00816.57
7.4.230.0000.00716.71
7.4.220.0000.00716.45
7.4.210.0080.00816.56
7.4.200.0070.00016.52
7.4.130.0100.01116.66
7.4.120.0110.00916.63
7.4.110.0080.01516.74
7.4.100.0110.00716.43
7.4.90.0150.00316.12
7.4.80.0100.01416.41
7.4.70.0120.00616.53
7.4.60.0100.01016.02
7.4.50.0110.01116.61
7.4.40.0060.01116.54
7.4.30.0070.01516.37
7.4.20.0160.00316.30
7.4.10.0060.01616.23
7.4.00.0160.00616.31
7.3.330.0030.00516.23
7.3.320.0050.00013.25
7.3.310.0030.00316.11
7.3.300.0060.00016.21
7.3.290.0100.00516.26
7.3.260.0140.01016.30
7.3.230.0130.01316.30
7.3.220.0080.00816.29
7.3.210.0090.00816.38
7.3.200.0090.00616.30
7.3.190.0120.00616.54
7.3.180.0140.00416.46
7.3.170.0120.00616.27
7.3.160.0060.01216.34
7.3.150.0100.00716.44
7.3.140.0060.01116.37
7.3.130.0070.01016.23
7.3.120.0100.01316.37
7.3.110.0180.00316.15
7.3.100.0110.01416.42
7.3.90.0130.00916.29
7.3.80.0120.00416.42
7.3.70.0090.00916.29
7.3.60.0100.00716.20
7.3.50.0160.00616.38
7.3.40.0030.01416.23
7.3.30.0190.00016.50
7.3.20.0270.00916.41
7.3.10.0190.00316.31
7.3.00.0070.01116.37
7.2.330.0060.01316.35
7.2.320.0080.01116.51
7.2.310.0150.00416.52
7.2.300.0100.01316.52
7.2.290.0060.01216.64
7.2.280.0040.01416.84
7.2.270.0040.01416.68
7.2.260.0110.01116.52
7.2.250.0090.01416.54
7.2.240.0060.01616.66
7.2.230.0080.01616.64
7.2.220.0090.00916.74
7.2.210.0070.01116.28
7.2.200.0120.00616.39
7.2.190.0030.01616.36
7.2.180.0150.00716.51
7.2.170.0060.01316.47
7.2.160.0120.00616.59
7.2.150.0120.01516.81
7.2.140.0100.01416.57
7.2.130.0030.01716.60
7.2.120.0030.01616.71
7.2.110.0120.01216.73
7.2.100.0100.00916.56
7.2.90.0120.01216.55
7.2.80.0200.00316.36
7.2.70.0130.01016.49
7.2.60.0060.01216.82
7.2.50.0040.01416.70
7.2.40.0090.00916.56
7.2.30.0130.00616.75
7.2.20.0110.00716.78
7.2.10.0100.01016.59
7.2.00.0090.00916.70

preferences:
35.95 ms | 403 KiB | 5 Q