3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Outer { protected $data; public function __construct($data) { $this->data = $data; } public function getArrayAccess() { /* create a proxy object implementing array access */ return new class($this->data) extends Outer implements ArrayAccess { public function offsetGet($offset) { return $this->data[$offset]; } public function offsetSet($offset, $data) { return ($this->data[$offset] = $data); } public function offsetUnset($offset) { unset($this->data[$offset]); } public function offsetExists($offset) { return isset($this->data[$offset]); } }; } } $outer = new Outer(array( rand(1, 100) )); /* not null because inheritance */ var_dump($outer->getArrayAccess()[0]);

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)
7.2.120.0230.00714.50
7.2.110.0190.01014.67
7.2.100.1320.00714.86
7.2.90.0260.00014.91
7.2.80.0210.00714.65
7.2.70.0430.01015.09
7.2.60.0430.00315.18
7.2.50.0440.00615.26
7.2.40.0430.00714.94
7.2.30.0290.00014.99
7.2.20.0250.00314.98
7.2.10.0210.00715.10
7.2.00.0280.01014.87
7.1.240.0220.00313.90
7.1.230.0390.00014.03
7.1.220.0180.00913.79
7.1.210.0250.00613.91
7.1.200.0220.00913.98
7.1.190.0300.00713.84
7.1.180.0370.01013.89
7.1.170.0480.01013.94
7.1.160.0400.00713.54
7.1.150.0310.00613.88
7.1.140.0240.01013.84
7.1.130.0240.00913.76
7.1.120.1060.00313.77
7.1.110.0280.00713.67
7.1.100.0240.01213.81
7.1.90.0350.01014.01
7.1.80.0260.00314.02
7.1.70.0180.00315.53
7.1.60.0180.00616.76
7.1.50.0280.01015.39
7.1.40.0260.01013.82
7.1.30.0220.00613.89
7.1.20.0250.00413.86
7.1.10.0160.01013.68
7.1.00.0190.03818.10
7.0.320.0200.01013.66
7.0.310.0240.01413.52
7.0.300.0270.00713.58
7.0.290.0320.00413.40
7.0.280.0270.00313.44
7.0.270.0400.00813.65
7.0.260.0280.01413.45
7.0.250.0420.00613.29
7.0.240.0340.00013.45
7.0.230.0280.00713.74
7.0.220.0330.00713.47
7.0.210.0280.00813.50
7.0.200.0180.00315.14
7.0.190.0370.00813.60
7.0.180.0270.00013.45
7.0.170.0220.01413.50
7.0.160.0330.01113.30
7.0.150.0350.01113.40
7.0.140.0180.02317.61
7.0.130.0470.00013.69
7.0.120.0370.00713.27
7.0.110.0360.00313.73
7.0.100.0620.01013.61
7.0.90.0320.00613.71
7.0.80.0260.01013.61
7.0.70.0320.00013.41
7.0.60.0160.04617.69
7.0.50.0180.02515.73
7.0.40.0180.04716.79
7.0.30.0310.04316.94
7.0.20.0300.04016.89
7.0.10.0230.04716.89
7.0.00.0180.04816.87
5.6.380.0070.00714.11
5.6.370.0100.01014.23
5.6.360.0120.00814.12
5.6.350.0110.00814.04
5.6.340.0140.00314.11
5.6.330.0140.00814.19
5.6.320.0140.00314.04
5.6.310.0160.00514.29
5.6.300.0180.00013.93
5.6.290.0170.00614.04
5.6.280.0050.04317.62
5.6.270.0160.00514.15
5.6.260.0110.01114.10
5.6.250.0140.00613.95
5.6.240.0090.01114.26
5.6.230.0000.01714.05
5.6.220.0080.01514.17
5.6.210.0200.03117.42
5.6.200.0110.03716.02
5.6.190.0130.02117.33
5.6.180.0090.02817.24
5.6.170.0240.03517.27
5.6.160.0120.04417.13
5.6.150.0150.01816.21
5.6.140.0070.03216.21
5.6.130.0150.03316.23
5.6.120.0150.04117.55
5.6.110.0050.02717.56
5.6.100.0160.04117.60
5.6.90.0060.04717.51
5.6.80.0070.02617.18
5.6.70.0150.00713.97
5.6.60.0080.01214.02
5.6.50.0040.01814.04
5.6.40.0080.01114.08
5.6.30.0130.00814.14
5.6.20.0100.01014.06
5.6.10.0080.00813.88
5.6.00.0120.00814.06
5.5.380.0050.00910.87
5.5.370.0060.00610.99
5.5.360.0070.00710.89
5.5.350.0160.03515.67
5.5.340.0040.02514.43
5.5.330.0050.04315.61
5.5.320.0320.04015.64
5.5.310.0170.03215.62
5.5.300.0070.04514.44
5.5.290.0080.02514.49
5.5.280.0050.03815.96
5.5.270.0090.04415.83
5.5.260.0110.04015.95
5.5.250.0140.04015.73
5.5.240.0170.04015.57
5.5.230.0080.00810.87
5.5.220.0120.00310.87
5.5.210.0160.00010.87
5.5.200.0100.00510.87
5.5.190.0100.00710.87
5.5.180.0100.00210.92
5.5.170.0130.00913.78
5.5.160.0150.00010.87
5.5.150.0080.00810.95
5.5.140.0080.00810.93
5.5.130.0100.00610.87
5.5.120.0100.00711.02
5.5.110.0110.00511.02
5.5.100.0130.00310.87
5.5.90.0100.00510.87
5.5.80.0120.00510.87
5.5.70.0080.00710.87
5.5.60.0080.00610.87
5.5.50.0040.00910.87
5.5.40.0120.00210.92
5.5.30.0100.00710.87
5.5.20.0090.00610.87
5.5.10.0110.00410.93
5.5.00.0110.00410.87
5.4.450.0080.03915.18
5.4.440.0090.02115.03
5.4.430.0050.04315.08
5.4.420.0070.02615.10
5.4.410.0090.03215.11
5.4.400.0060.02715.04
5.4.390.0110.03514.93
5.4.380.0090.02115.01
5.4.370.0070.03714.97
5.4.360.0100.02314.97
5.4.350.0040.02515.05
5.4.340.0060.02515.01
5.4.330.0140.00010.87
5.4.320.0030.02614.87
5.4.310.0070.03415.01
5.4.300.0040.02615.04
5.4.290.0080.03514.87
5.4.280.0060.02215.04
5.4.270.0060.02714.99
5.4.260.0070.02514.89
5.4.250.0060.02614.85
5.4.240.0060.02415.05
5.4.230.0090.04015.03
5.4.220.0110.04214.92
5.4.210.0080.02115.04
5.4.200.0110.03915.04
5.4.190.0090.03315.05
5.4.180.0120.03315.00
5.4.170.0130.02714.87
5.4.160.0080.03014.93
5.4.150.0070.03015.04
5.4.140.0080.02713.58
5.4.130.0040.02313.64
5.4.120.0040.04013.58
5.4.110.0060.03413.65
5.4.100.0120.03513.59
5.4.90.0060.02513.67
5.4.80.0060.04313.66
5.4.70.0060.03813.62
5.4.60.0070.03313.67
5.4.50.0060.02213.68
5.4.40.0100.04013.64
5.4.30.0040.02413.65
5.4.20.0060.02813.62
5.4.10.0070.03513.61
5.4.00.0040.04413.36
5.3.290.0070.03412.81
5.3.280.0100.03512.81
5.3.270.0100.04012.70
5.3.260.0030.03412.72
5.3.250.0110.04012.76
5.3.240.0040.03112.74
5.3.230.0100.04012.77
5.3.220.0080.02712.76
5.3.210.0070.02712.80
5.3.200.0030.03812.72
5.3.190.0120.02312.74
5.3.180.0060.03612.75
5.3.170.0030.04312.72
5.3.160.0100.02012.75
5.3.150.0070.02012.73
5.3.140.0130.03712.71
5.3.130.0140.03712.72
5.3.120.0050.04512.73
5.3.110.0100.03112.67
5.3.100.0110.03612.47
5.3.90.0040.02512.41
5.3.80.0050.02212.45
5.3.70.0050.02312.42
5.3.60.0050.02112.44
5.3.50.0050.02412.41
5.3.40.0080.02812.48
5.3.30.0050.02512.41
5.3.20.0040.02412.31
5.3.10.0050.04412.25
5.3.00.0100.02812.27
5.2.170.0080.03010.97
5.2.160.0060.02810.99
5.2.150.0050.02811.04
5.2.140.0060.01911.09
5.2.130.0060.02510.99
5.2.120.0070.03110.97
5.2.110.0070.02610.99
5.2.100.0060.03510.97
5.2.90.0100.02310.97
5.2.80.0100.02210.99
5.2.70.0080.03011.06
5.2.60.0070.03210.96
5.2.50.0110.02910.95
5.2.40.0120.01410.92
5.2.30.0020.02010.95
5.2.20.0050.01810.92
5.2.10.0110.01710.85
5.2.00.0030.01810.81
5.1.60.0060.02310.42
5.1.50.0060.02010.45
5.1.40.0050.01510.44
5.1.30.0130.02310.55
5.1.20.0050.01510.64
5.1.10.0040.02010.50
5.1.00.0060.02810.46
5.0.50.0020.0279.72
5.0.40.0000.0229.66
5.0.30.0030.0269.54
5.0.20.0050.0109.55
5.0.10.0050.0189.51
5.0.00.0050.0319.54
4.4.90.0030.0199.09
4.4.80.0030.0129.09
4.4.70.0020.0099.09
4.4.60.0020.0109.09
4.4.50.0030.0189.09
4.4.40.0000.0199.09
4.4.30.0020.0119.09
4.4.20.0000.0149.09
4.4.10.0030.0129.09
4.4.00.0030.0309.09
4.3.110.0030.0109.09
4.3.100.0030.0109.09
4.3.90.0030.0109.09
4.3.80.0000.0279.09
4.3.70.0010.0219.09
4.3.60.0020.0159.09
4.3.50.0050.0109.09
4.3.40.0040.0109.09
4.3.30.0020.0159.09
4.3.20.0050.0159.09
4.3.10.0000.0199.09
4.3.00.0000.0169.09

preferences:
45.4 ms | 401 KiB | 5 Q