3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface intf{ public function setVar($a); public function getVar(); } class A implements intf{ private $A; public function setVar($a){ $this->A=$a; } public function getVar(){ return $this->A; } } class B extends Abs{ private $B; public function setVar($a){ $this->B=$a; } public function getVar(){ return $this->B; } } abstract class Abs{ abstract public function setVar($a); abstract public function getVar(); public function getDouble($a){ return $a*2; } } $A=new A(); $B=new B(); $A->setVar(2); echo ' Class A: '.$A->getVar(); $B->setVar(4); echo ' Class B: '.$B->getVar(); echo ' Class B Double: '.$B->getDouble($B->getVar());
based on jlZB7

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0020.00516.94
7.2.00.0140.00319.54
7.1.200.0030.00815.62
7.1.100.0000.01618.06
7.1.70.0000.01117.28
7.1.60.2400.02032.95
7.1.50.3330.01032.79
7.1.40.1970.01332.46
7.1.30.0370.01032.71
7.1.20.3270.01732.52
7.1.10.2070.02014.64
7.1.00.2100.00714.72
7.0.200.3470.00715.09
7.0.190.3430.01714.79
7.0.180.2070.01014.18
7.0.170.4530.01714.32
7.0.160.3330.01314.59
7.0.150.1830.00714.57
7.0.140.1830.02014.45
7.0.130.2370.01314.48
7.0.120.1930.01714.60
7.0.110.2730.01314.36
7.0.100.3030.01314.30
7.0.90.1100.01014.42
7.0.80.2470.01314.66
7.0.70.2700.01714.41
7.0.60.2530.01714.23
7.0.50.2370.00014.50
7.0.40.2670.01314.66
7.0.30.2800.01014.64
7.0.20.2970.00714.48
7.0.10.2870.01314.61
7.0.00.2530.01014.53
hhvm-3.15.40.1370.26784.83
5.6.300.0200.09720.57
5.6.290.0130.08720.84
5.6.280.0270.06320.86
5.6.270.0230.06720.87
5.6.260.0330.07320.75
5.6.250.0170.08320.94
5.6.240.0130.09320.90
5.6.230.0200.08020.72
5.6.220.0270.07320.72
5.6.210.0170.07721.03
5.6.200.0200.05720.73
5.6.190.0230.08020.72
5.6.180.0330.07020.96
5.6.170.0170.08020.88
5.6.160.0500.06020.89
5.6.150.0130.09720.80
5.6.140.0100.07720.73
5.6.130.0230.08020.93
5.6.120.0300.07020.99
5.6.110.0470.06320.92
5.6.100.0370.06720.71
5.6.90.0230.08720.75
5.6.80.0130.07720.21
5.6.70.0300.06320.23
5.6.60.0170.08320.11
5.6.50.0100.07720.12
5.6.40.0070.08020.10
5.6.30.0100.07720.10
5.6.20.0100.08320.08
5.6.10.0070.08720.32
5.6.00.0270.06320.26