3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ArrayAccessInterface extends ArrayAccess { public function keyExists(string $offset): bool; public function offsetIsset(string $offset): bool; } abstract class ArrayAccessAbstract implements ArrayAccessInterface { public function offsetExists($offset): bool { return static::offsetIsset((string) $offset); } } class C extends ArrayAccessAbstract { public $data = array( "foo" => null ); public function keyExists(string $offset): bool { return array_key_exists($offset, $this->data); } public function offsetIsset(string $offset): bool { return isset($this->data[$offset]); } 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(empty($o['foo'])); var_dump(isset($o['foo'])); var_dump($o->keyExists('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.56
8.4.120.0070.00324.16
8.4.110.0120.00818.96
8.4.100.0080.00419.02
8.4.90.0130.00722.37
8.4.80.0070.00418.87
8.4.70.0050.00318.98
8.4.60.0080.00418.82
8.4.50.0160.00620.48
8.4.40.0070.01318.04
8.4.30.0160.00320.26
8.4.20.0160.00324.07
8.4.10.0030.00619.64
8.3.260.0140.00716.86
8.3.250.0120.00816.89
8.3.240.0120.00817.40
8.3.230.0050.00316.70
8.3.220.0100.00919.18
8.3.210.0140.00718.45
8.3.200.0050.00416.82
8.3.190.0070.01120.63
8.3.180.0060.00418.87
8.3.170.0120.00616.73
8.3.160.0110.00419.00
8.3.150.0150.00417.29
8.3.140.0090.00018.95
8.3.130.0030.00716.75
8.3.120.0070.00319.10
8.3.110.0100.01020.94
8.3.100.0060.01024.06
8.3.90.0080.00026.77
8.3.80.0000.00919.36
8.3.70.0090.00916.75
8.3.60.0070.01716.63
8.3.50.0120.00523.55
8.3.40.0070.01320.27
8.3.30.0060.00918.84
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0050.00226.16
8.2.290.0130.00520.59
8.2.280.0090.00718.38
8.2.270.0070.00716.75
8.2.260.0100.00718.37
8.2.250.0000.00816.76
8.2.240.0080.00017.55
8.2.230.0040.00422.58
8.2.220.0030.00537.54
8.2.210.0050.00326.77
8.2.200.0030.00618.88
8.2.190.0090.00618.29
8.2.180.0080.00825.92
8.2.170.0140.00719.19
8.2.160.0070.01022.96
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0040.00426.35
8.2.110.0040.00421.05
8.2.100.0080.00417.91
8.2.90.0040.00417.88
8.2.80.0000.00818.72
8.2.70.0040.00417.75
8.2.60.0040.00417.63
8.2.50.0040.00418.05
8.2.40.0030.00518.28
8.2.30.0040.00418.26
8.2.20.0040.00418.06
8.2.10.0040.00419.37
8.2.00.0040.00419.25
8.1.330.0120.00721.82
8.1.320.0080.01016.37
8.1.310.0130.00616.22
8.1.300.0060.00318.51
8.1.290.0090.00030.84
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0070.00319.13
8.1.230.0040.00720.95
8.1.220.0000.00818.56
8.1.210.0040.00418.77
8.1.200.0030.00517.43
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00317.62
8.1.160.0040.00419.02
8.1.150.0000.00718.91
8.1.140.0000.00718.89
8.1.130.0030.00320.03
8.1.120.0040.00417.46
8.1.110.0030.00517.49
8.1.100.0000.00817.47
8.1.90.0000.00717.39
8.1.80.0000.00717.34
8.1.70.0030.00317.36
8.1.60.0080.00017.56
8.1.50.0030.00517.47
8.1.40.0000.00917.51
8.1.30.0050.00317.68
8.1.20.0030.00617.68
8.1.10.0000.00817.52
8.1.00.0030.00617.52
8.0.300.0050.00218.77
8.0.290.0000.00816.75
8.0.280.0000.00718.45
8.0.270.0070.00018.02
8.0.260.0000.00818.38
8.0.250.0030.00716.96
8.0.240.0050.00316.99
8.0.230.0030.00316.85
8.0.220.0040.00416.82
8.0.210.0030.00716.89
8.0.200.0000.00616.84
8.0.190.0000.00716.98
8.0.180.0040.00416.96
8.0.170.0060.00316.88
8.0.160.0000.00716.89
8.0.150.0060.00316.83
8.0.140.0070.00016.86
8.0.130.0030.00313.37
8.0.120.0000.00816.90
8.0.110.0040.00416.89
8.0.100.0040.00416.96
8.0.90.0080.00016.75
8.0.80.0110.00316.80
8.0.70.0060.00316.69
8.0.60.0000.00816.93
8.0.50.0000.00716.85
8.0.30.0100.00616.98
8.0.20.0080.01117.17
8.0.10.0000.00717.07
8.0.00.0070.01316.76
7.4.330.0030.00215.55
7.4.320.0030.00316.57
7.4.300.0000.00716.56
7.4.290.0030.00316.62
7.4.280.0040.00416.60
7.4.270.0060.00316.62
7.4.260.0050.00013.19
7.4.250.0030.00316.40
7.4.240.0070.00016.38
7.4.230.0080.00016.54
7.4.220.0030.00416.52
7.4.210.0040.01016.59
7.4.200.0030.00316.40
7.4.130.0080.01316.58
7.4.120.0150.00616.43
7.4.110.0100.00716.40
7.4.100.0120.00416.52
7.4.90.0090.01316.46
7.4.80.0070.01016.39
7.4.70.0140.00416.52
7.4.60.0100.00716.54
7.4.50.0080.00816.48
7.4.40.0090.00916.35
7.4.30.0060.01116.49
7.4.20.0090.01216.59
7.4.10.0060.01516.57
7.4.00.0100.00716.41
7.3.330.0070.00016.34
7.3.320.0030.00613.41
7.3.310.0050.00316.20
7.3.300.0000.00616.19
7.3.290.0090.00516.39
7.3.260.0070.01016.63
7.3.230.0110.00616.57
7.3.220.0130.00416.17
7.3.210.0160.00016.50
7.3.200.0040.01216.39
7.3.190.0110.00616.34
7.3.180.0090.00616.28
7.3.170.0100.00616.40
7.3.160.0100.00616.29
7.3.150.0090.00916.35
7.3.140.0070.01016.21
7.3.130.0080.00816.41
7.3.120.0030.01416.39
7.3.110.0100.00616.45
7.3.100.0070.01016.40
7.3.90.0040.01516.14
7.3.80.0080.00816.29
7.3.70.0110.00716.29
7.3.60.0160.00616.46
7.3.50.0030.01316.24
7.3.40.0070.01016.28
7.3.30.0100.00716.23
7.3.20.0100.00716.24
7.3.10.0070.01016.24
7.3.00.0410.01016.29
7.2.330.0080.00816.43
7.2.320.0090.00616.50
7.2.310.0060.01016.82
7.2.300.0140.00416.34
7.2.290.0100.00716.34
7.2.280.0080.00916.40
7.2.270.0090.01216.43
7.2.260.0070.01016.45
7.2.250.0120.00616.49
7.2.240.0100.00716.60
7.2.230.0130.00316.79
7.2.220.0100.00716.92
7.2.210.0060.00916.61
7.2.200.0060.01316.65
7.2.190.0090.01216.52
7.2.180.0140.00516.68
7.2.170.0080.00816.69
7.2.160.0060.01216.73
7.2.150.0070.01016.59
7.2.140.0640.01016.70
7.2.130.0140.00316.60
7.2.120.0080.01216.76
7.2.110.0180.00016.68
7.2.100.0030.01516.58
7.2.90.0070.01016.61
7.2.80.0150.00416.52
7.2.70.0110.00716.62
7.2.60.0150.00916.68
7.2.50.0030.01316.76
7.2.40.0200.00016.59
7.2.30.0120.00616.68
7.2.20.0070.01116.48
7.2.10.0140.00416.70
7.2.00.0130.00616.46
7.1.330.0190.00915.63
7.1.320.0300.00515.67
7.1.310.0160.01215.66
7.1.300.0270.00015.55
7.1.290.0130.01315.54
7.1.280.0170.01015.57
7.1.270.0150.01115.52
7.1.260.0220.00515.46
7.1.250.0170.01315.66
7.1.240.0170.01215.50
7.1.230.0240.00515.55
7.1.220.0160.01215.56
7.1.210.0250.00715.34
7.1.200.0170.01015.58
7.1.190.0220.01115.71
7.1.180.0450.00715.65
7.1.170.0160.01515.33
7.1.160.0190.01115.53
7.1.150.0260.00515.51
7.1.140.0140.01415.54
7.1.130.0200.00815.53
7.1.120.0230.00715.61
7.1.110.0200.00815.64
7.1.100.0200.01015.54
7.1.90.0440.00715.54
7.1.80.0240.00615.59
7.1.70.0150.01515.55
7.1.60.0180.01115.50
7.1.50.0180.01415.45
7.1.40.0160.01315.59
7.1.30.0120.01615.39
7.1.20.0230.00715.55
7.1.10.0250.00415.61
7.1.00.0210.01115.62
7.0.330.0170.01115.39
7.0.320.0150.01115.43
7.0.310.0230.01015.21
7.0.300.0260.01115.28
7.0.290.0190.01615.44
7.0.280.0200.01415.26
7.0.270.0240.00315.21
7.0.260.0200.00915.25
7.0.250.0210.01015.14
7.0.240.0250.00615.34
7.0.230.0250.00915.32
7.0.220.0150.01515.19
7.0.210.0170.00915.36
7.0.200.0100.01815.21
7.0.190.0190.00815.28
7.0.180.0270.00515.32
7.0.170.0220.00615.28
7.0.160.0170.01015.29
7.0.150.0220.00715.38
7.0.140.0230.00615.26
7.0.130.0200.00915.02
7.0.120.0450.01015.29
7.0.110.0290.00715.29
7.0.100.0170.00815.17
7.0.90.0240.00215.21
7.0.80.0190.01315.30
7.0.70.0140.01415.54
7.0.60.0210.00515.24
7.0.50.0200.00815.41
7.0.40.0240.00415.29
7.0.30.0180.00915.32
7.0.20.0190.00815.30
7.0.10.0240.00315.16
7.0.00.0220.00615.35
5.6.400.0170.01515.77
5.6.390.0090.01915.81
5.6.380.0210.00915.87
5.6.370.0240.00915.84
5.6.360.0170.01115.73
5.6.350.0200.01015.69
5.6.340.0180.01215.78
5.6.330.0180.01515.63
5.6.320.0190.01215.89
5.6.310.0200.01215.62
5.6.300.0210.00915.88
5.6.290.0160.01315.83
5.6.280.0300.00615.82
5.6.270.0240.00415.76
5.6.260.0220.00915.58
5.6.250.0100.01915.80
5.6.240.0170.01215.77
5.6.230.0250.00615.82
5.6.220.0180.01215.71
5.6.210.0250.00415.65
5.6.200.0190.00915.71
5.6.190.0220.00915.70
5.6.180.0280.00015.75
5.6.170.0170.01015.59
5.6.160.0180.00915.66
5.6.150.0220.00615.69
5.6.140.0220.00715.59
5.6.130.0290.00015.54
5.6.120.0230.00615.50
5.6.110.0260.00315.52
5.6.100.0180.00915.56
5.6.90.0250.00615.74
5.6.80.0190.01315.48
5.6.70.0160.01315.59
5.6.60.0220.00615.77
5.6.50.0140.01415.48
5.6.40.0190.01015.56
5.6.30.0200.00815.61
5.6.20.0170.01415.69
5.6.10.0260.00315.52
5.6.00.0190.00815.66
5.5.380.0220.00615.59
5.5.370.0230.01015.78
5.5.360.0160.01615.49
5.5.350.0260.00915.60
5.5.340.0220.01515.75
5.5.330.0080.02115.38
5.5.320.0190.00815.52
5.5.310.0190.01415.71
5.5.300.0160.01115.63
5.5.290.0160.01315.53
5.5.280.0180.01015.47
5.5.270.0120.01515.63
5.5.260.0170.01115.46
5.5.250.0240.00615.41
5.5.240.0140.01415.40
5.5.230.0160.01315.66
5.5.220.0240.00315.58
5.5.210.0160.01315.66
5.5.200.0170.01115.62
5.5.190.0180.00915.41
5.5.180.0160.01215.46
5.5.170.0160.01315.55
5.5.160.0220.00515.47
5.5.150.0170.01415.52
5.5.140.0230.00815.64
5.5.130.0210.00815.73
5.5.120.0180.01115.62
5.5.110.0140.01415.59
5.5.100.0210.00615.64
5.5.90.0190.00815.62
5.5.80.0160.01215.54
5.5.70.0180.00915.42
5.5.60.0150.01215.53
5.5.50.0140.01415.49
5.5.40.0130.01715.54
5.5.30.0160.01215.55
5.5.20.0240.00715.34
5.5.10.0140.01415.54
5.5.00.0300.00315.41
5.4.450.0170.00412.56
5.4.440.0160.00812.39
5.4.430.0190.00312.48
5.4.420.0170.00912.60
5.4.410.0140.00712.29
5.4.400.0160.00612.48
5.4.390.0150.00612.34
5.4.380.0160.00612.34
5.4.370.0180.00412.39
5.4.360.0110.01112.52
5.4.350.0180.00312.32
5.4.340.0140.00712.19
5.4.330.0130.00912.31
5.4.320.0150.00612.45
5.4.310.0160.00712.28
5.4.300.0090.01412.42
5.4.290.0190.00312.32
5.4.280.0080.01312.26
5.4.270.0190.00412.39
5.4.260.0150.01012.28
5.4.250.0180.00412.36
5.4.240.0220.00412.42
5.4.230.0180.00312.28
5.4.220.0180.00412.55
5.4.210.0190.00612.38
5.4.200.0180.00412.31
5.4.190.0150.01312.34
5.4.180.0140.00912.40
5.4.170.0120.01012.40
5.4.160.0130.01012.16
5.4.150.0160.00812.43
5.4.140.0120.01212.57
5.4.130.0080.01212.39
5.4.120.0140.00812.37
5.4.110.0120.00812.57
5.4.100.0140.00712.48
5.4.90.0130.00712.46
5.4.80.0110.01112.53
5.4.70.0170.00712.48
5.4.60.0170.00912.46
5.4.50.0100.01012.51
5.4.40.0210.00412.31
5.4.30.0210.00312.46
5.4.20.0190.01012.34
5.4.10.0140.01112.31
5.4.00.0160.01112.38
5.3.290.0200.00312.93
5.3.280.0130.01012.64
5.3.270.0160.00512.72
5.3.260.0160.00612.86
5.3.250.0150.01212.85
5.3.240.0200.00312.59
5.3.230.0210.00012.64
5.3.220.0130.00912.66
5.3.210.0150.01112.82
5.3.200.0120.00912.70
5.3.190.0170.00712.71
5.3.180.0200.00213.02
5.3.170.0110.01512.84
5.3.160.0150.00812.99
5.3.150.0160.01012.84
5.3.140.0180.00412.78
5.3.130.0210.00612.78
5.3.120.0190.00912.80
5.3.110.0160.01312.91
5.3.100.0170.01212.80
5.3.90.0120.01812.83
5.3.80.0190.00612.73
5.3.70.0190.00812.66
5.3.60.0110.01612.89
5.3.50.0120.01212.84
5.3.40.0140.01112.88
5.3.30.0170.01312.70
5.3.20.0160.01412.79
5.3.10.0140.01012.47
5.3.00.0150.00812.50
5.2.170.0170.00811.86
5.2.160.0110.01111.81
5.2.150.0140.00911.79
5.2.140.0140.00911.70
5.2.130.0080.01211.73
5.2.120.0210.00011.80
5.2.110.0080.01111.73
5.2.100.0060.01311.89
5.2.90.0080.01211.82
5.2.80.0130.01011.82
5.2.70.0180.00411.76
5.2.60.0140.00711.58
5.2.50.0150.00511.70
5.2.40.0150.00811.70
5.2.30.0140.00911.59
5.2.20.0080.01211.54
5.2.10.0120.00811.45
5.2.00.0100.00711.37
5.1.60.0130.00510.86
5.1.50.0080.00811.08
5.1.40.0080.00810.90
5.1.30.0080.00811.15
5.1.20.0100.00710.90
5.1.10.0130.00611.00
5.1.00.0140.00310.70
5.0.50.0110.00610.68
5.0.40.0100.00510.68
5.0.30.0090.00910.68
5.0.20.0090.00510.68
5.0.10.0000.01710.68
5.0.00.0100.00310.68
4.4.90.0040.00610.68
4.4.80.0110.00010.68
4.4.70.0080.00410.68
4.4.60.0000.01010.68
4.4.50.0100.00010.68
4.4.40.0060.00310.68
4.4.30.0000.00910.68
4.4.20.0100.00010.68
4.4.10.0060.00310.68
4.4.00.0000.01110.68
4.3.110.0040.00410.68
4.3.100.0000.01010.68
4.3.90.0060.00310.68
4.3.80.0080.00310.68
4.3.70.0060.00610.68
4.3.60.0100.00010.68
4.3.50.0070.00310.68
4.3.40.0090.00010.68
4.3.30.0030.00510.68
4.3.20.0060.00310.68
4.3.10.0040.00410.68
4.3.00.0080.00010.68

preferences:
33.8 ms | 403 KiB | 5 Q