3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo implements ArrayAccess { private $container = array(); public function __construct() { $this->container = array(); } 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; } } $foo = new foo(); $foo['bar'] = 1; var_dump(array_key_exists('bar', $foo)); TRUE ? print "ok" : 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.3.60.0130.00618.68
8.3.50.0110.00722.05
8.3.40.0090.00619.15
8.3.30.0110.00419.18
8.3.20.0060.00320.29
8.3.10.0080.00021.95
8.3.00.0000.00822.40
8.2.180.0160.00316.75
8.2.170.0100.01022.96
8.2.160.0030.01020.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0060.00322.25
8.2.100.0100.00319.76
8.2.90.0000.00819.17
8.2.80.0040.00417.97
8.2.70.0050.00317.75
8.2.60.0040.00418.03
8.2.50.0080.00018.07
8.2.40.0040.00418.28
8.2.30.0050.00318.20
8.2.20.0000.00817.68
8.2.10.0040.00419.55
8.2.00.0000.00817.88
8.1.280.0090.00625.92
8.1.270.0030.00621.95
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0040.00423.84
8.1.230.0090.00319.10
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0040.00417.11
8.1.190.0000.00817.53
8.1.180.0030.00618.10
8.1.170.0050.00518.66
8.1.160.0040.00422.03
8.1.150.0000.00718.60
8.1.140.0070.00017.35
8.1.130.0000.00717.86
8.1.120.0000.00717.52
8.1.110.0070.00017.46
8.1.100.0070.00017.38
8.1.90.0050.00217.36
8.1.80.0000.00717.46
8.1.70.0000.00717.49
8.1.60.0000.00817.60
8.1.50.0040.00417.45
8.1.40.0000.00817.50
8.1.30.0040.00417.64
8.1.20.0030.00617.70
8.1.10.0070.00317.50
8.1.00.0040.00417.54
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0070.00018.47
8.0.270.0080.00017.15
8.0.260.0030.00316.96
8.0.250.0030.00317.06
8.0.240.0040.00417.04
8.0.230.0070.00017.02
8.0.220.0040.00416.91
8.0.210.0000.00716.95
8.0.200.0000.00617.02
8.0.190.0040.00416.93
8.0.180.0040.00417.06
8.0.170.0090.00016.91
8.0.160.0040.00417.01
8.0.150.0090.00016.85
8.0.140.0050.00216.94
8.0.130.0030.00313.37
8.0.120.0040.00416.97
8.0.110.0000.00717.00
8.0.100.0000.00716.91
8.0.90.0030.00516.96
8.0.80.0100.01016.97
8.0.70.0030.00516.85
8.0.60.0000.00716.88
8.0.50.0000.00716.93
8.0.30.0090.00917.09
8.0.20.0100.01017.40
8.0.10.0050.00317.13
8.0.00.0100.00916.81
7.4.330.0000.00615.01
7.4.320.0000.00616.54
7.4.300.0000.00616.44
7.4.290.0000.00716.63
7.4.280.0000.00716.61
7.4.270.0030.00316.61
7.4.260.0040.00416.53
7.4.250.0000.00716.50
7.4.240.0020.00516.63
7.4.230.0000.00716.51
7.4.220.0030.01416.73
7.4.210.0070.00816.64
7.4.200.0040.00416.60
7.4.190.0070.00016.39
7.4.160.0000.01716.70
7.4.150.0070.01417.40
7.4.140.0080.01217.86
7.4.130.0120.00916.70
7.4.120.0090.00916.55
7.4.110.0120.00616.50
7.4.100.0040.01316.52
7.4.90.0110.00716.53
7.4.80.0100.01419.39
7.4.70.0060.01016.43
7.4.60.0110.01216.39
7.4.50.0000.00816.51
7.4.40.0070.01122.77
7.4.30.0060.01216.54
7.4.00.0050.00914.88
7.3.330.0030.00313.41
7.3.320.0000.00513.46
7.3.310.0030.00516.54
7.3.300.0040.00416.45
7.3.290.0120.00316.44
7.3.280.0070.00916.47
7.3.270.0070.01617.40
7.3.260.0090.00916.72
7.3.250.0140.00516.43
7.3.240.0100.00616.47
7.3.230.0030.01316.68
7.3.210.0090.00916.57
7.3.200.0130.00319.39
7.3.190.0100.01316.54
7.3.180.0090.00616.25
7.3.170.0050.01416.46
7.3.160.0120.00316.38
7.3.120.0050.01014.80
7.3.110.0000.01814.56
7.3.100.0070.00714.81
7.3.90.0040.00714.86
7.3.80.0140.00014.91
7.3.70.0070.00714.64
7.3.60.0060.01014.84
7.3.50.0130.00314.63
7.3.40.0000.00814.83
7.3.30.0120.00314.79
7.3.20.0000.01016.34
7.3.10.0070.00416.58
7.3.00.0100.00316.61
7.2.330.0110.00716.70
7.2.320.0160.01016.46
7.2.310.0120.00616.68
7.2.300.0070.01116.70
7.2.290.0110.00616.61
7.2.250.0000.01815.14
7.2.240.0060.01015.17
7.2.230.0060.00915.19
7.2.220.0080.00815.13
7.2.210.0030.01015.17
7.2.200.0070.00415.18
7.2.190.0060.01014.99
7.2.180.0060.00914.75
7.2.170.0070.00715.11
7.1.330.0090.00615.80
7.1.320.0000.00915.63
7.1.310.0040.00415.54
7.1.300.0030.00915.82
7.1.290.0060.00915.76
7.1.280.0090.00615.86
7.1.270.0080.00415.77
7.1.260.0000.01115.58
7.1.100.0090.00318.41
7.1.70.0040.00417.16
7.1.60.0100.01619.82
7.1.50.0140.00717.15
7.1.00.0000.07722.24
7.0.200.0040.00416.67
7.0.140.0000.07722.21
7.0.60.0000.05320.04
7.0.50.0130.06317.91
7.0.40.0100.05720.26
7.0.30.0230.07720.23
7.0.20.0200.04720.10
7.0.10.0200.07020.30
7.0.00.0100.03720.06
5.6.280.0070.07020.93
5.6.210.0070.07320.63
5.6.200.0030.04018.18
5.6.190.0000.08320.77
5.6.180.0270.04320.49
5.6.170.0300.04320.54
5.6.160.0030.08020.57
5.6.150.0130.07718.28
5.6.140.0070.07718.22
5.6.130.0100.06718.23
5.6.120.0270.06321.05
5.6.110.0070.08321.01
5.6.100.0130.06721.10
5.6.90.0130.08321.09
5.6.80.0100.05320.42
5.5.350.0230.03320.35
5.5.340.0000.04017.93
5.5.330.0000.04320.21
5.5.320.0200.04320.51
5.5.310.0270.05320.30
5.5.300.0100.07718.09
5.5.290.0100.08018.02
5.5.280.0070.05020.88
5.5.270.0070.03720.95
5.5.260.0170.06720.73
5.5.250.0000.08320.48
5.5.240.0030.06320.17
5.4.450.0700.05319.18
5.4.440.0300.05719.61
5.4.430.0170.04719.63
5.4.420.0070.05719.46
5.4.410.0030.06319.08
5.4.400.0100.05018.63
5.4.390.0170.04718.52
5.4.380.0100.06018.63
5.4.370.0130.05318.55
5.4.360.0200.05018.74
5.4.350.0100.06318.57
5.4.340.0100.05718.62
5.4.320.0050.04512.51
5.4.310.0070.04112.50
5.4.300.0070.04212.50
5.4.290.0050.04512.51
5.4.280.0050.03712.40
5.4.270.0070.06018.79
5.4.260.0130.06018.84
5.4.250.0100.05719.07
5.4.240.0170.04718.92
5.4.230.0130.06018.78
5.4.220.0170.04718.78
5.4.210.0170.07018.92
5.4.200.0030.06018.73
5.4.190.0130.05319.02
5.4.180.0100.06318.80
5.4.170.0170.06318.88
5.4.160.0200.05318.97
5.4.150.0170.06018.73
5.4.140.0100.07016.36
5.4.130.0030.07016.58
5.4.120.0030.06716.51
5.4.110.0330.05716.54
5.4.100.0100.05316.43
5.4.90.0170.06316.54
5.4.80.0000.06716.38
5.4.70.0130.06716.45
5.4.60.0130.05316.38
5.4.50.0130.04716.36
5.4.40.0170.06016.38
5.4.30.0170.05316.53
5.4.20.0070.06016.57
5.4.10.0100.07316.37
5.4.00.0100.05315.94
5.3.290.0040.04712.80
5.3.280.0170.06314.77
5.3.270.0130.05714.61
5.3.260.0200.07014.75
5.3.250.0130.07314.63
5.3.240.0100.04714.70
5.3.230.0130.05714.59
5.3.220.0170.05714.48
5.3.210.0300.06014.64
5.3.200.0130.05014.71
5.3.190.0170.04314.74
5.3.180.0130.07314.66
5.3.170.0130.04714.47
5.3.160.0100.05714.73
5.3.150.0100.05314.55
5.3.140.0200.04314.47
5.3.130.0130.05014.62
5.3.120.0030.06314.52
5.3.110.0130.06714.57
5.3.100.0070.06714.15
5.3.90.0200.05014.11
5.3.80.0270.05314.01
5.3.70.0030.05314.25
5.3.60.0100.05314.01
5.3.50.0130.04314.13
5.3.40.0130.06014.04
5.3.30.0100.06313.99
5.3.20.0230.03713.69
5.3.10.0000.07713.49
5.3.00.0100.04713.63
5.2.170.0070.06011.16
5.2.160.0070.07011.33
5.2.150.0070.04011.24
5.2.140.0100.03711.11
5.2.130.0130.05011.27
5.2.120.0100.05311.09
5.2.110.0130.03710.94
5.2.100.0070.05011.08
5.2.90.0170.02711.18
5.2.80.0070.04311.27
5.2.70.0070.04711.01
5.2.60.0070.05010.91
5.2.50.0070.05711.13
5.2.40.0100.05311.23
5.2.30.0030.06010.98
5.2.20.0030.04711.07
5.2.10.0070.04310.82
5.2.00.0030.04010.70
5.1.60.0130.02710.04
5.1.50.0030.03710.01
5.1.40.0070.03310.23
5.1.30.0070.05310.40
5.1.20.0030.04310.44
5.1.10.0000.03710.17
5.1.00.0100.04310.23
5.0.50.0200.0208.55
5.0.40.0030.0278.34
5.0.30.0100.0508.29
5.0.20.0030.0338.30
5.0.10.0030.0378.27
5.0.00.0070.0508.14
4.4.90.0100.0307.20
4.4.80.0030.0207.20
4.4.70.0030.0277.20
4.4.60.0000.0307.20
4.4.50.0000.0337.20
4.4.40.0130.0237.20
4.4.30.0030.0207.20
4.4.20.0030.0277.20
4.4.10.0030.0277.20
4.4.00.0030.0437.20
4.3.110.0070.0207.20
4.3.100.0030.0237.20
4.3.90.0130.0207.20
4.3.80.0030.0337.20
4.3.70.0070.0277.20
4.3.60.0100.0237.20
4.3.50.0070.0207.20
4.3.40.0030.0407.20
4.3.30.0030.0207.20
4.3.20.0000.0337.20
4.3.10.0000.0237.20
4.3.00.0100.0236.95

preferences:
43.95 ms | 401 KiB | 5 Q