3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $foo = 10; protected $bar = 12; private $meh = 14; /** * @param string $key * @return boolean */ public function offsetExists($key) { return isset($this->{$key}); } /** * @param string $key * @return boolean */ public function offsetGet($key) { return method_exists($this, 'get'. ucfirst($key)) ? $this->{'get'. ucfirst($key)} : $this->{$key}; } /** * @param string $key * @param mixed $value */ public function offsetSet($key, $value) { method_exists($this, 'set'. ucfirst($key)) ? $this->{'set'. ucfirst($key)}($value) : $this->{$key} = $value; } /** * @param string $key */ public function offsetUnset($key) { unset($this->{$key}); } } $test = new Test; test var_dump(get_object_vars($test)); foreach($test as $param) { echo $param; }

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)
5.4.340.0030.03612.04
5.4.320.0030.03812.53
5.4.310.0040.03912.52
5.4.300.0070.03712.52
5.4.290.0060.03712.52
5.4.280.0060.03512.41
5.4.270.0070.03512.41
5.4.260.0060.04012.41
5.4.250.0030.03912.41
5.4.240.0040.04112.41
5.4.230.0100.03212.41
5.4.220.0050.03612.41
5.4.210.0090.03212.41
5.4.200.0050.03812.41
5.4.190.0050.03712.40
5.4.180.0020.04012.41
5.4.170.0060.03612.41
5.4.160.0070.03512.41
5.4.150.0060.04112.40
5.4.140.0060.03812.10
5.4.130.0070.03412.08
5.4.120.0040.04812.04
5.4.110.0030.03712.04
5.4.100.0010.04012.04
5.4.90.0100.03312.04
5.4.80.0070.03612.04
5.4.70.0060.03612.03
5.4.60.0090.03112.03
5.4.50.0050.03712.04
5.4.40.0050.03612.02
5.4.30.0080.03312.02
5.4.20.0070.03712.01
5.4.10.0060.03412.02
5.4.00.0040.03811.51
5.3.290.0050.04112.80
5.3.280.0080.04712.71
5.3.270.0110.04012.73
5.3.260.0050.04012.72
5.3.250.0030.04112.72
5.3.240.0070.04112.72
5.3.230.0070.03512.71
5.3.220.0040.03912.68
5.3.210.0060.03812.68
5.3.200.0040.03812.68
5.3.190.0090.03912.68
5.3.180.0090.03812.67
5.3.170.0070.03812.67
5.3.160.0060.04012.67
5.3.150.0060.03712.68
5.3.140.0060.04412.66
5.3.130.0050.04012.66
5.3.120.0060.03812.66
5.3.110.0090.03612.66
5.3.100.0080.03512.13
5.3.90.0030.03812.12
5.3.80.0060.03412.11
5.3.70.0100.03212.11
5.3.60.0040.04012.09
5.3.50.0030.04012.04
5.3.40.0060.03712.04
5.3.30.0090.03912.00
5.3.20.0060.04011.78
5.3.10.0030.04011.74
5.3.00.0020.04011.73
5.2.170.0040.0339.23
5.2.160.0050.0309.23
5.2.150.0070.0279.23
5.2.140.0050.0299.23
5.2.130.0060.0289.19
5.2.120.0050.0289.19
5.2.110.0020.0319.20
5.2.100.0050.0289.20
5.2.90.0080.0259.20
5.2.80.0050.0309.19
5.2.70.0040.0309.19
5.2.60.0030.0329.14
5.2.50.0060.0349.11
5.2.40.0070.0269.09
5.2.30.0050.0289.07
5.2.20.0070.0269.05
5.2.10.0060.0268.96
5.2.00.0070.0288.83
5.1.60.0030.0258.11
5.1.50.0060.0238.10
5.1.40.0060.0258.08
5.1.30.0080.0228.43
5.1.20.0040.0268.46
5.1.10.0040.0258.18
5.1.00.0030.0268.18
5.0.50.0020.0226.66
5.0.40.0020.0206.52
5.0.30.0050.0296.32
5.0.20.0030.0196.30
5.0.10.0030.0206.28
5.0.00.0030.0306.27
4.4.90.0040.0144.78
4.4.80.0020.0184.76
4.4.70.0040.0134.75
4.4.60.0030.0144.76
4.4.50.0020.0154.77
4.4.40.0020.0254.71
4.4.30.0030.0144.76
4.4.20.0050.0134.84
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0040.0144.67
4.3.100.0040.0134.66
4.3.90.0040.0134.63
4.3.80.0010.0264.58
4.3.70.0050.0124.63
4.3.60.0020.0184.63
4.3.50.0020.0184.63
4.3.40.0020.0244.54
4.3.30.0030.0193.30
4.3.20.0020.0173.28
4.3.10.0030.0143.24
4.3.00.0130.0237.13

preferences:
143.33 ms | 1394 KiB | 7 Q