3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ArrayObjectChild extends ArrayObject { public function offsetExists($offset) { var_dump('Called: '.__METHOD__); return parent::offsetExists($offset); } public function offsetGet($offset) { var_dump('Called: '.__METHOD__); return parent::offsetGet($offset); } } class ArrayAcessImplementation implements ArrayAccess { private $_array = array(); public function __construct(array $array) { $this->_array = $array; } public function offsetExists($offset) { var_dump('Called: '.__METHOD__); return array_key_exists($offset, $this->_array); } public function offsetGet($offset) { var_dump('Called: '.__METHOD__); return $this->_array[$offset]; } public function offsetSet($offset, $value) {} public function offsetUnset($offset) {} } $array = array('foo' => ''); echo "ArrayObject extended:\n"; $object = new ArrayObjectChild($array); var_dump(isset($object['foo']), empty($object['foo'])); echo "ArrayObject:\n"; $object = new ArrayObject($array); var_dump(isset($object['foo']), empty($object['foo'])); echo "ArrayAccess implemented:\n"; $object = new ArrayAcessImplementation($array); var_dump(isset($object['foo']), empty($object['foo']));

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.0100.00718.29
8.3.50.0140.00321.27
8.3.40.0150.00018.84
8.3.30.0150.00619.04
8.3.20.0040.00420.36
8.3.10.0040.00422.09
8.3.00.0050.00322.40
8.2.180.0130.01016.38
8.2.170.0040.01122.96
8.2.160.0070.00719.34
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0030.00519.66
8.2.110.0060.00321.90
8.2.100.0120.00018.09
8.2.90.0000.00819.34
8.2.80.0000.00917.97
8.2.70.0000.00917.50
8.2.60.0040.00417.93
8.2.50.0000.01018.07
8.2.40.0060.00318.34
8.2.30.0040.00418.13
8.2.20.0080.00017.75
8.2.10.0040.00417.75
8.2.00.0000.00817.77
8.1.280.0090.00925.92
8.1.270.0040.00418.68
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.89
8.1.230.0070.00418.97
8.1.220.0050.00317.77
8.1.210.0050.00318.77
8.1.200.0070.00317.48
8.1.190.0040.00417.54
8.1.180.0040.00418.65
8.1.170.0000.00818.66
8.1.160.0040.00422.07
8.1.150.0040.00418.54
8.1.140.0040.00417.54
8.1.130.0030.00317.81
8.1.120.0040.00417.46
8.1.110.0040.00417.41
8.1.100.0040.00417.49
8.1.90.0030.00617.45
8.1.80.0000.00717.52
8.1.70.0030.00317.47
8.1.60.0040.00417.50
8.1.50.0050.00217.60
8.1.40.0040.00417.53
8.1.30.0030.00517.48
8.1.20.0000.00917.59
8.1.10.0040.00417.70
8.1.00.0000.00817.43
8.0.300.0000.00718.77
8.0.290.0000.00817.28
8.0.280.0080.00018.40
8.0.270.0030.00317.29
8.0.260.0030.00316.79
8.0.250.0040.00416.88
8.0.240.0080.00017.01
8.0.230.0070.00016.81
8.0.220.0040.00416.91
8.0.210.0000.00716.89
8.0.200.0030.00316.87
8.0.190.0000.00716.89
8.0.180.0070.00016.88
8.0.170.0030.00616.94
8.0.160.0040.00416.83
8.0.150.0040.00416.88
8.0.140.0030.00616.79
8.0.130.0000.00513.35
8.0.120.0030.00516.75
8.0.110.0040.00416.91
8.0.100.0030.00516.95
8.0.90.0040.00416.98
8.0.80.0000.01516.90
8.0.70.0000.00816.74
8.0.60.0000.00716.83
8.0.50.0040.00416.77
8.0.30.0140.00517.13
8.0.20.0150.00417.40
8.0.10.0040.00416.88
8.0.00.0070.01216.75
7.4.330.0000.00615.00
7.4.320.0030.00316.52
7.4.300.0060.00016.45
7.4.290.0090.00016.61
7.4.280.0070.00016.42
7.4.270.0000.00716.52
7.4.260.0000.00716.53
7.4.250.0000.00816.59
7.4.240.0030.00416.57
7.4.230.0070.00016.43
7.4.220.0030.01416.55
7.4.210.0130.00516.50
7.4.200.0000.00716.44
7.4.190.0030.00316.69
7.4.160.0120.00616.40
7.4.150.0130.00517.40
7.4.140.0170.02217.86
7.4.130.0090.00916.52
7.4.120.0100.00616.42
7.4.110.0100.01316.59
7.4.100.0100.01316.70
7.4.90.0120.00616.54
7.4.80.0190.00019.39
7.4.70.0060.01216.46
7.4.60.0060.01616.49
7.4.50.0050.00316.59
7.4.40.0090.00622.77
7.4.30.0120.00616.38
7.4.00.0060.00914.82
7.3.330.0030.00313.28
7.3.320.0000.00613.16
7.3.310.0070.00016.36
7.3.300.0030.00316.21
7.3.290.0100.00716.27
7.3.280.0090.00616.35
7.3.270.0140.00317.40
7.3.260.0060.01216.32
7.3.250.0080.01116.40
7.3.240.0070.01116.40
7.3.230.0080.01216.52
7.3.210.0120.00616.29
7.3.200.0060.01619.39
7.3.190.0120.00616.38
7.3.180.0100.00716.58
7.3.170.0140.00616.56
7.3.160.0140.00216.54
7.3.120.0000.01414.71
7.3.10.0080.00816.51
7.3.00.0080.00716.36
7.2.330.0160.00316.70
7.2.320.0090.00916.81
7.2.310.0070.01516.73
7.2.300.0040.01216.86
7.2.290.0060.01216.84
7.2.130.0130.00516.60
7.2.120.0050.01016.48
7.2.110.0050.01216.46
7.2.100.0090.00916.85
7.2.90.0120.00816.79
7.2.80.0070.00916.72
7.2.70.0110.01016.77
7.2.60.0130.00716.70
7.2.50.0070.01116.77
7.2.40.0100.00616.58
7.2.30.0120.00516.78
7.2.20.0100.00616.55
7.2.10.0080.00916.64
7.2.00.0050.00916.85
7.1.250.0080.00715.79
7.1.100.0100.01017.91
7.1.70.0040.00417.26
7.1.60.0160.00719.82
7.1.50.0100.01617.05
7.1.00.0030.06722.44
7.0.200.0050.00216.77
7.0.140.0030.07321.96
7.0.60.0130.08020.04
7.0.50.0030.08317.88
7.0.40.0170.04320.30
7.0.30.0300.08020.16
7.0.20.0300.07020.23
7.0.10.0030.08320.24
7.0.00.0100.07020.12
5.6.280.0070.06721.10
5.6.210.0030.07020.71
5.6.200.0130.06718.16
5.6.190.0130.06020.43
5.6.180.0530.06320.50
5.6.170.0330.07720.56
5.6.160.0100.08020.54
5.6.150.0070.05718.15
5.6.140.0070.06718.18
5.6.130.0100.03718.14
5.6.120.0070.08320.99
5.6.110.0200.06321.16
5.6.100.0070.08021.01
5.6.90.0070.04720.97
5.6.80.0000.06720.55
5.5.350.0200.08320.41
5.5.340.0100.06318.10
5.5.330.0070.06720.57
5.5.320.0230.04020.20
5.5.310.0200.05320.26
5.5.300.0100.04317.98
5.5.290.0030.06317.96
5.5.280.0100.06020.67
5.5.270.0070.08720.77
5.5.260.0200.06720.75
5.5.250.0130.07720.61
5.5.240.0070.07020.17
5.4.450.0130.06719.51
5.4.440.0530.07319.44
5.4.430.0730.05319.38
5.4.420.0330.05019.32
5.4.410.0870.06319.10
5.4.400.1070.04318.51
5.4.390.1370.05018.83
5.4.380.0230.06318.79
5.4.370.0100.05718.75
5.4.360.0030.06318.63
5.4.350.0230.04318.79
5.4.340.0130.05318.76
5.4.320.0060.03812.52
5.4.310.0030.04412.52
5.4.300.0070.04512.52
5.4.290.0090.03912.52
5.4.280.0070.03512.41
5.4.270.0070.03812.42
5.4.260.0080.04312.42
5.4.250.0170.05018.73
5.4.240.0030.07319.09
5.4.230.0100.05018.94
5.4.220.0100.07718.95
5.4.210.0100.05718.96
5.4.200.0170.06318.84
5.4.190.0070.07019.02
5.4.180.0070.05319.09
5.4.170.0130.05318.95
5.4.160.0230.04319.00
5.4.150.0170.06318.89
5.4.140.0130.07016.60
5.4.130.0030.06016.47
5.4.120.0200.05716.51
5.4.110.0130.05016.77
5.4.100.0100.06716.38
5.4.90.0170.04016.53
5.4.80.0170.06016.61
5.4.70.0070.07016.34
5.4.60.0100.05016.49
5.4.50.0130.06316.46
5.4.40.0030.05316.44
5.4.30.0170.04716.35
5.4.20.0130.07316.53
5.4.10.0130.04716.34
5.4.00.0230.05315.99
5.3.290.0050.04712.80
5.3.280.0170.06014.68
5.3.270.0100.06314.65
5.3.260.0170.06314.80
5.3.250.0070.05314.78
5.3.240.0230.06314.71
5.3.230.0070.05714.68
5.3.220.0070.05714.68
5.3.210.0070.06714.56
5.3.200.0070.06714.57
5.3.190.0100.06714.81
5.3.180.0000.07314.76
5.3.170.0000.06314.67
5.3.160.0100.05014.57
5.3.150.0100.05314.76
5.3.140.0070.05014.48
5.3.130.0170.05714.39
5.3.120.0170.04714.55
5.3.110.0130.06714.63
5.3.100.0100.04714.24
5.3.90.0000.07714.17
5.3.80.0070.05314.23
5.3.70.0130.04714.13
5.3.60.0030.05314.20
5.3.50.0130.06014.05
5.3.40.0000.06013.97
5.3.30.0100.06714.02
5.3.20.0100.06313.81
5.3.10.0130.04313.66
5.3.00.0030.06313.74
5.2.170.0200.03311.26
5.2.160.0070.06011.26
5.2.150.0070.04011.09
5.2.140.0070.04311.33
5.2.130.0070.04011.20
5.2.120.0130.03311.03
5.2.110.0030.05311.11
5.2.100.0100.03711.16
5.2.90.0100.06011.02
5.2.80.0100.03711.29
5.2.70.0030.04311.12
5.2.60.0070.04310.98
5.2.50.0070.04311.13
5.2.40.0130.04010.88
5.2.30.0030.06310.89
5.2.20.0100.05011.05
5.2.10.0070.05310.96
5.2.00.0200.04310.73
5.1.60.0100.04710.26
5.1.50.0070.03010.03
5.1.40.0070.03310.24
5.1.30.0130.03010.44
5.1.20.0100.03310.55
5.1.10.0070.04010.05
5.1.00.0070.03310.05
5.0.50.0000.0408.60
5.0.40.0070.0278.51
5.0.30.0070.0578.07
5.0.20.0100.0278.16
5.0.10.0030.0408.25
5.0.00.0130.0378.01
4.4.90.0070.0207.83
4.4.80.0070.0177.83
4.4.70.0070.0277.83
4.4.60.0070.0207.83
4.4.50.0000.0337.83
4.4.40.0070.0377.83
4.4.30.0000.0237.83
4.4.20.0030.0237.83
4.4.10.0070.0277.83
4.4.00.0070.0337.83
4.3.110.0030.0207.83
4.3.100.0030.0237.83
4.3.90.0000.0307.83
4.3.80.0030.0407.83
4.3.70.0030.0207.83
4.3.60.0030.0277.83
4.3.50.0000.0307.83
4.3.40.0000.0437.83
4.3.30.0000.0277.83
4.3.20.0030.0237.83
4.3.10.0070.0207.83
4.3.00.0030.0237.63

preferences:
45.26 ms | 401 KiB | 5 Q