3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class r { protected $a = null; public function __construct($a){$this->a = $a;} public function add(){$this->a++;} public function getVal(){return $this->a;} } class a { private function test($ref) { $ref->add(); } public function __call($f, $a) { call_user_func_array(array($this, $f), $a); } } $x = new r(10); $a = new a(); $a->test($x); echo $x->getVal();
based on 4OQc5

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.3.10.0130.00016.69
7.3.00.0060.00616.66
7.2.130.0030.01217.05
7.2.120.0040.00816.70
7.2.110.0080.00516.77
7.2.100.0090.00316.92
7.2.90.0030.01016.76
7.2.80.0070.01116.80
7.2.70.0030.00616.54
7.2.60.0040.01116.98
7.2.50.0030.01416.99
7.2.40.0100.00316.66
7.2.30.0040.00816.80
7.2.20.0030.01316.76
7.2.10.0090.00616.69
7.2.00.0020.00918.30
7.1.250.0040.00415.79
7.1.200.0040.00715.60
7.1.100.0040.00718.14
7.1.70.0000.01017.16
7.1.60.0110.01419.22
7.1.50.0090.01216.63
7.1.00.0070.07322.57
7.0.200.0030.00716.86
7.0.140.0000.07322.21
7.0.60.0000.04720.01
7.0.50.0030.05017.86
7.0.40.0100.03720.09
7.0.30.0300.07020.27
7.0.20.0200.03720.15
7.0.10.0070.05020.25
7.0.00.0070.08320.33
5.6.280.0030.07320.79
5.6.210.0000.07020.76
5.6.200.0070.08018.19
5.6.190.0030.09320.33
5.6.180.0300.05020.50
5.6.170.0270.03320.55
5.6.160.0170.04020.52
5.6.150.0070.07018.23
5.6.140.0070.06718.11
5.6.130.0030.04318.21
5.6.120.0100.07721.04
5.6.110.0070.09021.02
5.6.100.0170.06320.89
5.6.90.0030.08021.13
5.6.80.0030.08020.39
5.5.350.0170.06320.47
5.5.340.0100.07317.98
5.5.330.0070.09020.47
5.5.320.0200.06720.42
5.5.310.0230.05720.52
5.5.300.0100.03317.98
5.5.290.0130.03718.06
5.5.280.0100.07720.66
5.5.270.0030.05320.89
5.5.260.0130.05720.89
5.5.250.0070.03720.60
5.5.240.0100.07720.04
5.4.450.0870.04319.55
5.4.440.0770.05719.43
5.4.430.0670.05019.22
5.4.420.1130.05719.28
5.4.410.0800.04719.45
5.4.400.0770.05319.16
5.4.390.0100.05719.18
5.4.380.0200.05018.63
5.4.370.0130.05718.79
5.4.360.0130.05318.48
5.4.350.0130.05718.61
5.4.340.0130.06018.63
5.4.320.0130.05718.76
5.4.310.0100.05718.63
5.4.300.0100.05718.80
5.4.290.0270.05318.75
5.4.280.0230.05018.77
5.4.270.0170.05318.53
5.4.260.0170.05318.74
5.4.250.0100.06318.70
5.4.240.0200.05018.47
5.4.230.0130.05718.73
5.4.220.0230.05018.55
5.4.210.0230.06018.77
5.4.200.0170.05316.63
5.4.190.0300.05018.82
5.4.180.0270.04318.71
5.4.170.0200.05318.61
5.4.160.0200.05018.48
5.4.150.0230.06018.61
5.4.140.0270.04016.46
5.4.130.0130.05316.42
5.4.120.0100.05716.45
5.4.110.0200.05016.23
5.4.100.0270.04716.32
5.4.90.0130.05716.46
5.4.80.0200.05316.16
5.4.70.0230.04716.14
5.4.60.0200.05016.33
5.4.50.0130.05316.27
5.4.40.0200.05016.16
5.4.30.0230.04716.14
5.4.20.0170.07016.21
5.4.10.0230.04716.38
5.4.00.0230.04015.71
5.3.290.0100.06014.73
5.3.280.0100.06014.82
5.3.270.0170.05314.84
5.3.260.0130.06014.83
5.3.250.0270.05014.67
5.3.240.0200.04714.63
5.3.230.0330.03714.62
5.3.220.0100.05714.57
5.3.210.0170.05314.68
5.3.200.0170.05014.59
5.3.190.0130.05714.67
5.3.180.0030.06314.57
5.3.170.0100.05714.61
5.3.160.0200.04714.64
5.3.150.0200.04714.61
5.3.140.0200.05014.55
5.3.130.0270.04314.59
5.3.120.0200.04714.68
5.3.110.0170.05314.53
5.3.100.0070.06314.25
5.3.90.0170.05714.08
5.3.80.0230.04314.14
5.3.70.0130.05314.07
5.3.60.0200.04314.07
5.3.50.0100.05714.18
5.3.40.0130.05314.12
5.3.30.0230.04314.05
5.3.20.0200.04713.80
5.3.10.0100.05313.77
5.3.00.0200.04713.70
5.2.170.0200.05011.28
5.2.160.0200.03311.19
5.2.150.0200.03311.18
5.2.140.0130.04011.18
5.2.130.0100.04011.18
5.2.120.0070.04311.21
5.2.110.0030.04711.23
5.2.100.0170.03311.22
5.2.90.0170.03711.34
5.2.80.0170.03711.15
5.2.70.0100.04311.32
5.2.60.0300.03311.27
5.2.50.0170.03711.13
5.2.40.0070.04711.04
5.2.30.0230.03711.02
5.2.20.0100.05011.04
5.2.10.0100.04011.07
5.2.00.0200.03310.76
5.1.60.0100.0339.98
5.1.50.0170.03310.09
5.1.40.0100.03710.11
5.1.30.0070.04010.41
5.1.20.0130.03710.57
5.1.10.0200.03010.25
5.1.00.0070.03710.12
5.0.50.0030.0308.65
5.0.40.0030.0308.52
5.0.30.0130.0378.36
5.0.20.0130.0208.28
5.0.10.0100.0238.22
5.0.00.0170.0338.35
4.4.90.0070.0235.94
4.4.80.0070.0205.97
4.4.70.0070.0206.00
4.4.60.0030.0235.88
4.4.50.0070.0205.89
4.4.40.0030.0375.89
4.4.30.0000.0275.98
4.4.20.0100.0176.05
4.4.10.0000.0275.97
4.4.00.0030.0375.98
4.3.110.0030.0305.89
4.3.100.0100.0175.84
4.3.90.0100.0175.86
4.3.80.0070.0335.91
4.3.70.0100.0175.79
4.3.60.0100.0175.78
4.3.50.0100.0175.78
4.3.40.0100.0305.75
4.3.30.0030.0205.01
4.3.20.0000.0275.01
4.3.10.0000.0275.01
4.3.00.0100.0237.60