3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Derp; abstract class A { public $stuff = array(); abstract public function __construct(); } class B extends A { protected $kids; protected $log; //public $stuff; public function __construct() { //$this->bee(); } public function bee() { $this->kids = new C($this); $this->kids->cee(); } public function updateLog($msg) { $this->log[] = $msg; } } class C //extends A { public $Cups = "cCup"; //public $stuff; public function __construct($b) { //$this->bee(); $this->Cups = $b; } public function cee() { $this->stuff = array("MyStuff"); $this->Cups->updateLog("This"); $this->Cups->updateLog("That"); } } $b = new B(); $x = $b->bee();
based on 5a820

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.00.0090.00919.30
7.1.100.0070.00418.05
7.1.70.0030.00617.02
7.1.60.0140.01119.46
7.1.50.0120.01216.82
7.1.00.0100.07022.30
7.0.200.0040.00416.77
7.0.140.0100.04722.18
7.0.60.0130.04720.01
7.0.50.0030.08017.92
7.0.40.0170.07720.10
7.0.30.0200.04320.23
7.0.20.0300.08020.15
7.0.10.0100.08720.12
7.0.00.0030.05320.33
5.6.280.0100.06721.13
5.6.210.0070.08020.66
5.6.200.0100.06018.19
5.6.190.0030.04720.61
5.6.180.0300.05020.33
5.6.170.0230.07720.45
5.6.160.0230.04720.54
5.6.150.0130.06318.18
5.6.140.0130.07718.16
5.6.130.0030.08018.26
5.6.120.0030.08320.98
5.6.110.0100.08020.98
5.6.100.0030.06721.01
5.6.90.0000.04721.19
5.6.80.0100.08020.38
5.5.350.4070.04720.37
5.5.340.0030.04018.02
5.5.330.0100.03720.45
5.5.320.0170.04720.30
5.5.310.0300.07720.24
5.5.300.0070.06018.04
5.5.290.0030.05318.01
5.5.280.0070.08320.66
5.5.270.0030.04020.78
5.5.260.0130.04020.89
5.5.250.0170.06320.63
5.5.240.0030.07720.28
5.4.450.0970.05019.31
5.4.440.0100.06019.28
5.4.430.0170.05719.63
5.4.420.0170.07719.50
5.4.410.0170.05019.18
5.4.400.0230.04319.23
5.4.390.0300.04718.61
5.4.380.0270.05318.73
5.4.370.0230.05318.47
5.4.360.0270.04718.73
5.4.350.0370.05318.78
5.4.340.0300.04318.78
5.4.320.0270.04718.58
5.4.310.0170.05718.78
5.4.300.0170.05718.50
5.4.290.0230.05318.75
5.4.280.0200.05718.60
5.4.270.0300.07018.70
5.4.260.0170.06018.50
5.4.250.0230.05318.73
5.4.240.0300.04718.58
5.4.230.0200.05318.72
5.4.220.0270.05018.73
5.4.210.0270.05018.78
5.4.200.0200.05716.79
5.4.190.0230.05018.75
5.4.180.0300.05718.73
5.4.170.0170.06018.71
5.4.160.0270.04718.71
5.4.150.0170.05718.45
5.4.140.0230.05316.38
5.4.130.0200.05016.20
5.4.120.0230.04716.29
5.4.110.0200.05016.20
5.4.100.0200.05316.22
5.4.90.0200.05716.23
5.4.80.0230.04716.31
5.4.70.0300.04016.16
5.4.60.0230.04716.42
5.4.50.0230.06016.41
5.4.40.0200.05016.24
5.4.30.0270.05316.30
5.4.20.0270.04316.40
5.4.10.0300.05016.18
5.4.00.0170.05315.87
5.3.290.0230.05714.71
5.3.280.0170.06014.66
5.3.270.0400.04714.64
5.3.260.0130.06014.61
5.3.250.0270.05014.74
5.3.240.0130.06014.66
5.3.230.0230.05014.65
5.3.220.0230.05014.60
5.3.210.0170.05714.64
5.3.200.0200.05714.76
5.3.190.0070.06314.69
5.3.180.0300.04314.63
5.3.170.0230.05314.70
5.3.160.0200.05314.68
5.3.150.0200.05314.57
5.3.140.0170.05314.77
5.3.130.0300.05014.78
5.3.120.0230.05714.61
5.3.110.0230.05314.62
5.3.100.0230.05314.11
5.3.90.0170.05714.18
5.3.80.0300.04314.16
5.3.70.0200.05314.01
5.3.60.0270.04714.04
5.3.50.0200.05014.13
5.3.40.0200.05314.02
5.3.30.0200.05013.96
5.3.20.0270.04313.88
5.3.10.0200.05313.65
5.3.00.0130.05713.88
5.2.170.0130.04711.13
5.2.160.0130.04311.09
5.2.150.0230.03711.13
5.2.140.0130.04711.20
5.2.130.0200.04011.15
5.2.120.0200.03711.08
5.2.110.0200.03711.07
5.2.100.0230.03011.14
5.2.90.0200.03711.26
5.2.80.0100.04711.15
5.2.70.0200.04011.06
5.2.60.0130.04311.03
5.2.50.0200.03711.05
5.2.40.0130.04011.04
5.2.30.0200.03711.03
5.2.20.0170.03710.93
5.2.10.0170.03710.92
5.2.00.0130.04010.77
5.1.60.0100.03710.05
5.1.50.0170.03010.05
5.1.40.0170.03010.03
5.1.30.0100.04010.47
5.1.20.0130.03710.37
5.1.10.0200.03010.04
5.1.00.0130.03710.12
5.0.50.0100.0278.57
5.0.40.0100.0238.42
5.0.30.0100.0438.24
5.0.20.0070.0278.32
5.0.10.0130.0238.20
5.0.00.0100.0408.35
4.4.90.0100.0175.88
4.4.80.0070.0205.85
4.4.70.0100.0205.85
4.4.60.0070.0205.89
4.4.50.0070.0205.92
4.4.40.0030.0375.91
4.4.30.0070.0235.87
4.4.20.0070.0205.96
4.4.10.0030.0235.88
4.4.00.0100.0335.85
4.3.110.0030.0235.83
4.3.100.0070.0205.75
4.3.90.0170.0175.80
4.3.80.0070.0335.82
4.3.70.0030.0235.80
4.3.60.0070.0205.84
4.3.50.0070.0205.77
4.3.40.0030.0375.77
4.3.30.0070.0204.56
4.3.20.0000.0274.59
4.3.10.0000.0234.54
4.3.00.0130.0207.18