3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Countable { public $prop1; private $propa=2; protected $propx=3; public $prop4 = array(1,2,3,4); public function Greet() { return 'hello world'; } public function getCount() { $res = (array) $this; return count($res); } public function count() { return $this->getCount(); } } $t = new Test; echo $t->Greet(),"\n"; echo count( (array) $t),"\n"; echo $t->getCount(),"\n"; echo count($t),"\n"; var_dump( get_object_vars($t) ); $ao = (ArrayObject) $t; echo count($ao);

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.280.0110.05612.39
5.4.270.0130.05112.39
5.4.260.0090.05912.39
5.4.250.0120.05012.38
5.4.240.0050.05612.38
5.4.230.0090.05412.38
5.4.220.0130.04812.38
5.4.210.0080.05212.38
5.4.200.0090.05412.38
5.4.190.0190.10512.37
5.4.180.0130.06512.38
5.4.170.0120.04912.38
5.4.160.0110.04812.38
5.4.150.0100.05212.38
5.4.140.0150.09212.07
5.4.130.0120.06312.05
5.4.120.0090.05012.01
5.4.110.0080.05312.01
5.4.100.0080.04912.00
5.4.90.0080.05512.01
5.4.80.0070.04812.00
5.4.70.0090.05112.01
5.4.60.0090.04912.00
5.4.50.0120.04812.00
5.4.40.0110.04711.99
5.4.30.0070.05111.99
5.4.20.0190.05011.98
5.4.10.0120.04411.98
5.4.00.0100.04611.48
5.3.280.0070.05212.71
5.3.270.0080.06012.72
5.3.260.0100.05612.72
5.3.250.0110.05312.72
5.3.240.0210.06312.72
5.3.230.0130.05212.71
5.3.220.0210.04312.68
5.3.210.0130.05412.68
5.3.200.0090.03712.68
5.3.190.0080.05112.68
5.3.180.0090.03612.68
5.3.170.0110.05012.67
5.3.160.0140.04912.68
5.3.150.0120.05512.68
5.3.140.0100.05212.66
5.3.130.0150.05412.66
5.3.120.0130.05612.66
5.3.110.0120.05512.66
5.3.100.0080.05612.11
5.3.90.0080.05712.08
5.3.80.0120.04612.07
5.3.70.0090.05012.07
5.3.60.0110.04812.07
5.3.50.0080.05212.00
5.3.40.0110.05012.00
5.3.30.0080.03711.97
5.3.20.0090.03411.74
5.3.10.0090.04611.71
5.3.00.0080.05111.70

preferences:
140.32 ms | 1394 KiB | 7 Q