3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Obj implements ArrayAccess { public $container = [ "one" => 1, "two" => 2, "three" => 3, ]; public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } public function offsetExists($offset): bool { return isset($this->container[$offset]); } public function offsetUnset($offset): void { unset($this->container[$offset]); } public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $o = new Obj(); if (array_key_exists('a', $o)) { echo "has-a"; } else { echo "NO-a"; }

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.0080.01218.09
8.4.120.0130.00720.58
8.4.110.0120.00918.67
8.4.100.0410.01017.96
8.4.90.0120.00819.56
8.4.80.0420.00718.07
8.4.70.0260.00817.78
8.4.60.0220.00317.92
8.4.50.0180.00617.87
8.4.40.0230.00417.88
8.4.30.0430.00517.84
8.4.20.0180.00717.77
8.4.10.0430.00617.84
8.3.260.0120.00816.62
8.3.250.0100.00817.14
8.3.240.0110.00716.73
8.3.230.0180.00416.76
8.3.220.0190.00416.66
8.3.210.0200.00416.46
8.3.200.0200.00416.43
8.3.190.0200.00316.60
8.3.180.0260.00516.70
8.3.170.0190.00416.34
8.3.160.0280.01416.45
8.3.150.0460.01016.39
8.3.140.0190.00616.89
8.3.130.0160.00516.65
8.3.120.0280.00316.44
8.3.110.0370.00716.63
8.3.100.0430.00916.43
8.3.90.0430.00716.57
8.3.80.0370.01016.45
8.3.70.0420.01016.95
8.3.60.0400.01216.43
8.3.50.0510.01016.64
8.3.40.0480.00517.52
8.3.30.0350.00917.47
8.3.20.0350.01017.56
8.3.10.0330.00817.26
8.3.00.0370.00717.47
8.2.290.0310.00916.55
8.2.280.0250.00916.80
8.2.270.0140.00616.87
8.2.260.0160.00316.63
8.2.250.0200.00316.61
8.2.240.0160.00316.50
8.2.230.0180.00516.51
8.2.220.0150.00616.46
8.2.210.0140.00516.26
8.2.200.0170.00416.36
8.2.190.0270.00516.32
8.2.180.0130.00516.40
8.2.170.0380.00917.59
8.2.160.0350.00917.77
8.2.150.0310.00517.56
8.2.140.0340.00617.47
8.2.130.0350.01217.63
8.2.120.0270.00517.65
8.2.110.0350.01017.74
8.2.100.0320.00917.79
8.2.90.0310.01017.86
8.2.80.0160.00417.71
8.2.70.0200.00317.30
8.2.60.0190.00117.43
8.2.50.0320.00917.43
8.2.40.0320.00817.85
8.2.30.0320.00617.63
8.2.20.0300.00917.58
8.2.10.0350.00717.48
8.2.00.0290.01217.45
8.1.330.0330.00816.52
8.1.320.0350.00516.57
8.1.310.0300.00416.42
8.1.300.0360.00415.93
8.1.290.0360.01116.18
8.1.280.0320.00716.05
8.1.270.0240.00517.35
8.1.260.0150.00317.26
8.1.250.0280.01317.38
8.1.240.0300.00917.13
8.1.230.0260.00717.27
8.1.220.0220.00417.38
8.1.210.0280.00717.22
8.1.200.0350.00617.01
8.1.190.0320.00717.14
8.1.180.0250.00717.14
8.1.170.0330.01016.78
8.1.160.0340.00517.17
8.1.150.0250.01317.05
8.1.140.0360.00617.37
8.1.130.0350.00617.34
8.1.120.0360.00717.23
8.1.110.0280.01017.28
8.1.100.0300.00816.87
8.1.90.0350.00817.45
8.1.80.0420.00717.35
8.1.70.0320.00717.16
8.1.60.0320.00817.42
8.1.50.0260.01117.36
8.1.40.0330.00917.33
8.1.30.0340.00916.97
8.1.20.0220.00517.21
8.1.10.0200.00917.39
8.1.00.0240.00917.16
8.0.300.0190.00516.71
8.0.290.0300.00716.69
8.0.280.0280.00616.83
8.0.270.0310.00616.59
8.0.260.0310.00816.26
8.0.250.0250.01216.48
8.0.240.0320.00616.44
8.0.230.0300.00716.64
8.0.220.0220.00916.71
8.0.210.0330.00516.59
8.0.200.0410.00716.79
8.0.190.0340.00616.77
8.0.180.0410.00516.63
8.0.170.0330.00716.68
8.0.160.0270.00916.79
8.0.150.0310.00816.64
8.0.140.0340.00616.67
8.0.130.0280.00616.68
8.0.120.0280.00416.66
8.0.110.0280.01116.70
8.0.100.0340.00416.75
8.0.90.0410.00516.40
8.0.80.0300.00516.46
8.0.70.0320.00616.63
8.0.60.0330.00616.75
8.0.50.0220.00416.63
8.0.30.0170.00916.72
8.0.20.0220.01316.63
8.0.10.0300.00916.72
8.0.00.0270.00716.70
7.4.330.0360.00916.22
7.4.320.0310.00616.14
7.4.300.0260.00816.44
7.4.290.0310.00516.21
7.4.280.0290.00716.32
7.4.270.0320.00416.38
7.4.260.0220.01016.31
7.4.250.0280.00816.12
7.4.240.0240.00916.25
7.4.230.0290.00716.30
7.4.220.0290.00616.27
7.4.210.0230.00716.42
7.4.200.0350.00416.20
7.4.190.0280.00816.18
7.4.180.0390.00216.39
7.4.160.0270.01216.47
7.4.150.0310.00716.15
7.4.140.0260.01316.12
7.4.130.0280.00716.22
7.4.120.0230.00916.24
7.4.110.0280.00415.98
7.4.100.0300.01116.15
7.4.90.0220.00216.17
7.4.80.0160.00716.33
7.4.70.0290.00415.99
7.4.60.0300.00716.11
7.4.50.0260.00516.02
7.4.40.0230.00816.27
7.4.30.0300.00616.20
7.4.20.0290.00716.26
7.4.10.0280.00916.16
7.4.00.0240.00816.30
7.3.330.0300.00715.80
7.3.320.0260.00615.87
7.3.310.0360.00615.77
7.3.300.0330.00315.97
7.3.290.0290.00715.68
7.3.280.0300.00516.07
7.3.270.0240.00816.15
7.3.260.0200.00515.92
7.3.250.0260.01015.80
7.3.240.0360.00216.15
7.3.230.0270.00615.89
7.3.220.0350.00615.73
7.3.210.0260.00815.87
7.3.200.0270.00615.99
7.3.190.0240.00416.01
7.3.180.0220.00915.75
7.3.170.0310.00715.90
7.3.160.0210.00716.02
7.3.150.0150.00316.27
7.3.140.0140.00416.00
7.3.130.0110.00616.01
7.3.120.0090.00816.01
7.3.110.0170.00415.62
7.3.100.0140.00215.75
7.3.90.0130.00316.05
7.3.80.0130.00315.91
7.3.70.0270.00315.88
7.3.60.0310.00416.07
7.3.50.0240.00415.93
7.3.40.0270.00816.19
7.3.30.0300.00516.35
7.3.20.0320.00618.09
7.3.10.0320.00417.68
7.3.00.0250.00717.85
7.2.340.0240.00915.82
7.2.330.0300.00716.02
7.2.320.0340.00715.88
7.2.310.0250.00615.90
7.2.300.0140.00316.27
7.2.290.0180.00216.02
7.2.280.0300.00516.15
7.2.270.0230.00815.97
7.2.260.0310.00616.30
7.2.250.0220.00916.11
7.2.240.0280.00916.12
7.2.230.0290.00716.02
7.2.220.0240.00916.27
7.2.210.0160.00716.11
7.2.200.0330.00716.28
7.2.190.0310.00516.35
7.2.180.0320.00716.47
7.2.170.0270.00516.29
7.2.160.0130.00316.39
7.2.150.0320.00617.95
7.2.140.0290.00518.17
7.2.130.0240.00718.41
7.2.120.0280.00917.97
7.2.110.0310.00817.95
7.2.100.0200.00317.95
7.2.90.0170.00518.00
7.2.80.0190.00618.13
7.2.70.0210.00518.30
7.2.60.0300.01218.32
7.2.50.0330.00317.83
7.2.40.0270.00917.96
7.2.30.0310.00417.91
7.2.20.0170.00518.11
7.2.10.0290.00418.05
7.2.00.0260.00817.96
7.1.330.0280.00216.97
7.1.320.0160.00716.91
7.1.310.0120.00417.03
7.1.300.0120.00316.85
7.1.290.0120.00216.86
7.1.280.0110.00416.88
7.1.270.0110.00616.92
7.1.260.0240.00916.66
7.1.250.0270.00316.89
7.1.240.0280.00516.92
7.1.230.0250.00716.82
7.1.220.0280.00516.93
7.1.210.0240.00816.98
7.1.200.0260.00617.05
7.1.190.0240.00916.76
7.1.180.0320.00716.91
7.1.170.0230.00816.85
7.1.160.0090.00716.78
7.1.150.0280.00516.85
7.1.140.0250.01016.79
7.1.130.0270.00516.80
7.1.120.0250.00616.79
7.1.110.0270.00516.72
7.1.100.0260.00917.05
7.1.90.0230.00916.89
7.1.80.0300.00617.31
7.1.70.0210.01116.74
7.1.60.0200.00317.04
7.1.50.0250.00617.02
7.1.40.0320.00616.94
7.1.30.0240.00717.14
7.1.20.0250.01017.14
7.1.10.0240.00817.19
7.1.00.0310.00516.95
7.0.330.0250.00416.59
7.0.320.0250.00616.78
7.0.310.0240.00716.79
7.0.300.0200.01116.88
7.0.290.0290.00316.62
7.0.280.0240.00816.85
7.0.270.0320.00416.39
7.0.260.0190.00816.72
7.0.250.0230.00817.08
7.0.240.0240.00816.96
7.0.230.0240.00716.80
7.0.220.0280.00316.90
7.0.210.0280.00617.01
7.0.200.0260.00516.86
7.0.190.0270.00516.68
7.0.180.0260.00616.72
7.0.170.0230.00816.94
7.0.160.0260.00516.96
7.0.150.0250.00616.79
7.0.140.0250.00916.57
7.0.130.0320.00516.85
7.0.120.0240.00716.87
7.0.110.0260.00916.64
7.0.100.0230.00916.93
7.0.90.0280.01016.78
7.0.80.0240.00716.72
7.0.70.0250.00916.59
7.0.60.0230.00816.99
7.0.50.0250.00716.55
7.0.40.0250.00916.77
7.0.30.0210.00916.77
7.0.20.0220.01016.80
7.0.10.0280.00416.79
7.0.00.0280.00716.57
5.6.400.0280.00415.32
5.6.390.0240.00915.28
5.6.380.0370.00615.34
5.6.370.0310.00715.55
5.6.360.0200.00715.13
5.6.350.0240.00415.21
5.6.340.0230.00815.16
5.6.330.0260.00615.28
5.6.320.0280.00415.49
5.6.310.0230.00915.65
5.6.300.0190.00815.20
5.6.290.0210.00815.34
5.6.280.0250.00415.38
5.6.270.0260.00715.43
5.6.260.0230.00815.21
5.6.250.0230.00915.32
5.6.240.0240.00715.25
5.6.230.0280.00515.71
5.6.220.0260.00415.64
5.6.210.0220.00715.30
5.6.200.0250.00715.58
5.6.190.0100.00415.38
5.6.180.0130.00515.40
5.6.170.0220.00815.59
5.6.160.0230.00815.35
5.6.150.0210.01115.35
5.6.140.0300.00115.59
5.6.130.0260.00815.47
5.6.120.0300.00515.35
5.6.110.0130.00115.30
5.6.100.0230.00715.46
5.6.90.0230.00615.42
5.6.80.0160.00315.54
5.6.70.0120.00515.40
5.6.60.0160.00215.36
5.6.50.0260.00515.45
5.6.40.0220.00615.16
5.6.30.0160.00415.13
5.6.20.0120.00315.36
5.6.10.0230.00715.30
5.6.00.0230.00815.23
5.5.380.0240.00715.53
5.5.370.0230.00815.41
5.5.360.0250.00715.07
5.5.350.0260.00615.32
5.5.340.0290.00415.27
5.5.330.0240.00815.32
5.5.320.0260.00615.28
5.5.310.0190.00915.27
5.5.300.0220.00715.11
5.5.290.0240.00815.43
5.5.280.0250.00615.33
5.5.270.0210.01015.18
5.5.260.0250.00615.23
5.5.250.0220.00815.66
5.5.240.0200.00415.56
5.5.230.0250.00615.57
5.5.220.0260.00515.40
5.5.210.0250.00615.39
5.5.200.0230.00915.33
5.5.190.0260.00515.04
5.5.180.0240.00615.35
5.5.170.0260.00615.04
5.5.160.0320.00815.12
5.5.150.0220.00815.18
5.5.140.0250.00715.04
5.5.130.0210.00915.04
5.5.120.0250.00315.11
5.5.110.0220.00415.05
5.5.100.0220.00815.21
5.5.90.0240.01015.30
5.5.80.0260.00815.41
5.5.70.0280.00315.50
5.5.60.0220.00715.40
5.5.50.0260.00515.39
5.5.40.0240.00715.22
5.5.30.0230.00715.33
5.5.20.0220.00415.44
5.5.10.0260.00515.40
5.5.00.0250.00715.24
5.4.450.0180.00615.04
5.4.440.0180.00815.04
5.4.430.0240.00415.04
5.4.420.0190.00815.04
5.4.410.0180.00715.04
5.4.400.0210.00415.04
5.4.390.0200.00515.04
5.4.380.0200.00515.04
5.4.370.0200.00515.04
5.4.360.0190.00615.04
5.4.350.0100.00215.04
5.4.340.0210.00515.04
5.4.330.0200.00515.04
5.4.320.0200.00615.04
5.4.310.0130.00315.04
5.4.300.0180.00415.04
5.4.290.0190.00515.04
5.4.280.0120.00315.04
5.4.270.0180.00515.04
5.4.260.0180.00615.04
5.4.250.0170.00515.04
5.4.240.0230.00515.04
5.4.230.0190.01015.04
5.4.220.0170.00915.04
5.4.210.0220.00315.04
5.4.200.0200.00415.04
5.4.190.0170.00415.04
5.4.180.0220.00215.04
5.4.170.0220.00215.04
5.4.160.0210.00615.04
5.4.150.0220.00715.04
5.4.140.0200.00615.04
5.4.130.0190.00815.04
5.4.120.0190.00415.04
5.4.110.0180.00615.04
5.4.100.0190.00615.04
5.4.90.0190.00615.04
5.4.80.0190.00515.04
5.4.70.0180.00715.04
5.4.60.0190.00515.04
5.4.50.0250.00515.04
5.4.40.0150.00815.04
5.4.30.0200.00715.04
5.4.20.0200.00415.04
5.4.10.0210.00315.04
5.4.00.0150.00815.04
5.3.290.0230.00215.04
5.3.280.0210.00415.04
5.3.270.0200.00515.04
5.3.260.0230.00315.04
5.3.250.0200.00615.04
5.3.240.0230.00415.04
5.3.230.0240.00315.04
5.3.220.0160.00715.04
5.3.210.0090.00415.04
5.3.200.0200.00515.04
5.3.190.0190.00715.04
5.3.180.0170.00915.04
5.3.170.0180.00215.04
5.3.160.0110.00215.04
5.3.150.0080.00415.04
5.3.140.0090.00415.04
5.3.130.0090.00415.04
5.3.120.0220.00215.04
5.3.110.0220.00315.04
5.3.100.0080.00315.04
5.3.90.0100.00215.04
5.3.80.0100.00715.04
5.3.70.0140.00615.04
5.3.60.0090.00215.04
5.3.50.0090.00215.04
5.3.40.0090.00315.04
5.3.30.0200.00515.04
5.3.20.0160.00715.04
5.3.10.0170.00515.04
5.3.00.0130.00615.04
5.2.170.0140.00715.04
5.2.160.0160.00515.04
5.2.150.0150.00515.04
5.2.140.0190.00215.04
5.2.130.0150.00515.04
5.2.120.0160.00315.04
5.2.110.0170.00315.04
5.2.100.0150.00515.04
5.2.90.0160.00615.04
5.2.80.0140.00615.04
5.2.70.0150.00615.04
5.2.60.0150.00615.04
5.2.50.0150.00715.04
5.2.40.0120.01015.04
5.2.30.0180.00515.04
5.2.20.0180.00515.04
5.2.10.0070.00215.04
5.2.00.0120.00415.04
5.1.60.0140.00115.04
5.1.50.0110.00715.04
5.1.40.0110.00615.04
5.1.30.0150.00515.04
5.1.20.0120.00415.04
5.1.10.0140.00215.04
5.1.00.0160.00415.04
5.0.50.0140.00415.04
5.0.40.0130.00215.04
5.0.30.0100.00515.04
5.0.20.0140.00215.04
5.0.10.0110.00515.04
5.0.00.0120.00215.04
4.4.90.0070.00115.04
4.4.80.0080.00115.04
4.4.70.0090.00015.04
4.4.60.0070.00215.04
4.4.50.0050.00315.04
4.4.40.0060.00215.04
4.4.30.0070.00215.04
4.4.20.0070.00215.04
4.4.10.0070.00215.04
4.4.00.0070.00215.04
4.3.110.0070.00215.04
4.3.100.0070.00115.04
4.3.90.0070.00215.04
4.3.80.0070.00215.04
4.3.70.0090.00015.04
4.3.60.0080.00115.04
4.3.50.0080.00115.04
4.3.40.0080.00115.04
4.3.30.0070.00015.04
4.3.20.0060.00115.04
4.3.10.0050.00215.04
4.3.00.0050.00215.04

preferences:
66.39 ms | 403 KiB | 5 Q