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 foo($val){ echo __FUNCTION__;,": \n"; test($val); } } $objBla = new bla(); $objBla->bar("someval"); if (phpversion() >= "7.0.0"){ ($objBla->foo)("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.0300.06720.09
7.0.10.0100.05320.10
7.0.00.0100.03720.21
5.6.170.0100.05020.45
5.6.160.0170.07320.54
5.6.150.0070.08018.25
5.6.140.0070.06718.19
5.6.130.0070.05318.28
5.6.120.0130.07721.13
5.6.110.0030.09021.10
5.6.100.0100.03320.90
5.6.90.0070.07021.09
5.6.80.0100.07720.39
5.5.310.0230.05720.41
5.5.300.0030.04017.99
5.5.290.0100.07017.95
5.5.280.0030.07020.77
5.5.270.0030.04720.80
5.5.260.0030.05720.89
5.5.250.0030.04020.69
5.5.240.0270.07020.20

preferences:
141.27 ms | 1394 KiB | 7 Q