3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($var){ echo "test $var\n"; } class bla { public $foo = "test"; public function bar($str) { echo $this->foo($str),"\n"; // php5 fails w/o method below specified } public function bar_none($str) { if (phpversion() >= "7.0.0"){ echo ($this->foo)($str),"\n"; // php7 works } } public function foo($val){ test($val); } } $objBla = new bla(); $objBla->bar("someval"); $objBla->bar_none("nother val";)

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.0.20.0430.06020.07
7.0.10.0070.07720.06
7.0.00.0130.07320.23
5.6.170.0170.04320.62
5.6.160.0070.07720.61
5.6.150.0030.05718.27
5.6.140.0130.07318.28
5.6.130.0070.04318.18
5.6.120.0130.03721.03
5.6.110.0070.07721.05
5.6.100.0000.04320.98
5.6.90.0000.09320.98
5.6.80.0030.08020.29
5.5.310.0230.08720.38
5.5.300.0030.03717.97
5.5.290.0070.08318.08
5.5.280.0100.08320.80
5.5.270.0100.08020.76
5.5.260.0070.08020.77
5.5.250.0100.03320.71
5.5.240.0170.06020.24

preferences:
139.36 ms | 1394 KiB | 7 Q