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.0370.07320.33
7.0.10.0170.08020.32
7.0.00.0100.07720.24
5.6.170.0200.04020.57
5.6.160.0100.08020.43
5.6.150.0070.06318.12
5.6.140.0070.07318.16
5.6.130.0030.04018.26
5.6.120.0000.06020.98
5.6.110.0170.07721.00
5.6.100.0070.03721.15
5.6.90.0070.08721.01
5.6.80.0070.08020.41
5.5.310.0270.03720.36
5.5.300.0000.04018.01
5.5.290.0030.08018.05
5.5.280.0130.05720.88
5.5.270.0130.05020.85
5.5.260.0070.07720.96
5.5.250.0000.04320.71
5.5.240.0230.06720.36

preferences:
142.45 ms | 1394 KiB | 7 Q