3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Foo { private $traitProperty = 'blah'; public function getTraitProperty() { return $this->traitProperty; } public function getClassPropertyFromTrait() { return $this->classProperty; } } class MyClass { use Foo; private $classProperty = 'meh'; public function getTraitPropertyFromClass() { return $this->traitProperty; } public function getClassProperty() { return $this->classProperty; } } $x = new MyClass(); var_dump($x->getTraitProperty()); var_dump($x->getTraitPropertyFromClass()); var_dump($x->getClassProperty()); var_dump($x->getClassPropertyFromTrait());

Here you find the average performance (time & memory) of each version. A greyed 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.0beta10.0030.00712.86
7.3.0alpha10.0070.00312.69
7.2.60.0110.00016.69
7.2.00.0030.01019.35
7.1.200.0090.00615.70
7.1.100.0110.00017.99
7.1.70.0030.01017.25
7.1.60.0130.01019.50
7.1.50.0180.00616.95
7.1.00.0030.07722.51
7.0.200.0450.00314.59
7.0.60.0130.04021.59
7.0.50.0030.04017.84
7.0.40.0030.04017.79
7.0.30.0100.05017.82
7.0.20.0070.08317.74
7.0.10.0070.08317.84
7.0.00.0100.08317.84
5.6.280.0100.06721.10
5.6.210.0030.04320.76
5.6.200.0070.05718.18
5.6.190.0100.03318.21
5.6.180.0030.04018.27
5.6.170.0070.04018.17
5.6.160.0030.07018.27
5.6.150.0170.06718.21
5.6.140.0130.03318.15
5.6.130.0170.03018.21
5.6.120.0070.06718.25
5.6.110.0030.04318.28
5.6.100.0000.05018.13
5.6.90.0170.05718.16
5.6.80.0030.05017.67
5.6.70.0100.07717.52
5.6.60.0200.06317.65
5.6.50.0100.07317.50
5.6.40.0000.05717.50
5.6.30.0130.06317.51
5.6.20.0030.08017.60
5.6.10.0130.04717.50
5.6.00.0100.04317.47
5.5.350.4130.04320.39
5.5.340.0030.04017.98
5.5.330.0000.04018.02
5.5.320.0030.03717.98
5.5.310.0030.08718.06
5.5.300.0070.04017.94
5.5.290.0070.04017.94
5.5.280.0100.07718.08
5.5.270.0100.08318.04
5.5.260.0130.07318.06
5.5.250.0070.07017.73
5.5.240.0130.07017.39
5.5.230.0100.07317.46
5.5.220.0070.08017.33
5.5.210.0070.08017.39
5.5.200.0030.05317.32
5.5.190.0070.05017.34
5.5.180.0100.07317.43
5.5.160.0030.06017.32
5.5.150.0100.06717.31
5.5.140.0100.06317.27
5.5.130.0000.09017.43
5.5.120.0030.06017.33
5.5.110.0000.04717.30
5.5.100.0070.06017.34
5.5.90.0170.04717.23
5.5.80.0100.06317.33
5.5.70.0130.05017.32
5.5.60.0130.07017.20
5.5.50.0000.08317.19
5.5.40.0170.05317.20
5.5.30.0030.07317.32
5.5.20.0030.04317.18
5.5.10.0100.07317.20
5.5.00.0070.07317.27
5.4.450.0000.04319.60
5.4.440.0070.08019.38
5.4.430.0200.06319.44
5.4.420.0130.07019.46
5.4.410.0130.04319.28
5.4.400.0100.08019.04
5.4.390.0270.05718.97
5.4.380.0030.07719.05
5.4.370.0000.04319.06
5.4.360.0100.07019.11
5.4.350.0100.07318.88
5.4.340.0000.08318.86
5.4.320.0070.05719.01
5.4.310.0100.07319.09
5.4.300.0070.04319.10
5.4.290.0070.07319.03
5.4.280.0170.06719.05
5.4.270.0070.08319.09
5.4.260.0130.04018.95
5.4.250.0030.04019.21
5.4.240.0030.07719.07
5.4.230.0070.05719.14
5.4.220.0000.06019.08
5.4.210.0030.08019.04
5.4.200.0070.07019.13
5.4.190.0070.06719.02
5.4.180.0070.06718.96
5.4.170.0100.04319.11
5.4.160.0130.07018.99
5.4.150.0070.07019.03
5.4.140.0000.05016.34
5.4.130.0070.07016.43
5.4.120.0070.07316.40
5.4.110.0100.07316.42
5.4.100.0130.06716.52
5.4.90.0030.04016.46
5.4.80.0070.07016.27
5.4.70.0000.04716.62
5.4.60.0130.06316.54
5.4.50.0030.03716.52
5.4.40.0130.06716.43
5.4.30.0130.06016.39
5.4.20.0070.03316.39
5.4.10.0070.06716.35
5.4.00.0130.06015.80
5.3.290.0030.05314.66
5.3.280.0100.07014.59
5.3.270.0070.08014.57
5.3.260.0100.07314.40
5.3.250.0100.04014.46
5.3.240.0100.05714.69
5.3.230.0000.08314.56
5.3.220.0000.05314.48
5.3.210.0000.04314.50
5.3.200.0130.05014.35
5.3.190.0070.05714.34
5.3.180.0030.05014.42
5.3.170.0030.07714.51
5.3.160.0000.05314.42
5.3.150.0000.05014.34
5.3.140.0070.03314.38
5.3.130.0100.07014.48
5.3.120.0100.03714.48
5.3.110.0130.05014.48
5.3.100.0030.07714.00
5.3.90.0070.04314.01
5.3.80.0070.03313.94
5.3.70.0070.03313.99
5.3.60.0030.06714.07
5.3.50.0030.07713.91
5.3.40.0070.07313.91
5.3.30.0030.07013.85
5.3.20.0000.07713.64
5.3.10.0100.06713.57
5.3.00.0070.06713.57
5.2.170.0070.05311.08
5.2.160.0100.06011.17
5.2.150.0030.05011.17
5.2.140.0030.06311.12
5.2.130.0100.06010.88
5.2.120.0100.05711.09
5.2.110.0000.06311.04
5.2.100.0070.05711.07
5.2.90.0030.04010.92
5.2.80.0100.04711.02
5.2.70.0070.03711.04
5.2.60.0070.06011.03
5.2.50.0100.06310.84
5.2.40.0030.04010.98
5.2.30.0070.06310.79
5.2.20.0100.05710.93
5.2.10.0070.06010.86
5.2.00.0030.02710.75
5.1.60.0030.0579.93
5.1.50.0030.0279.98
5.1.40.0070.0539.91
5.1.30.0030.05710.33
5.1.20.0000.04010.38
5.1.10.0070.05010.11
5.1.00.0030.05710.11
5.0.50.0070.0308.48
5.0.40.0000.0508.39
5.0.30.0100.0638.25
5.0.20.0030.0308.25
5.0.10.0000.0408.25
5.0.00.0000.0638.25
4.4.90.0000.0178.25
4.4.80.0070.0308.25
4.4.70.0030.0308.25
4.4.60.0030.0338.25
4.4.50.0000.0238.25
4.4.40.0070.0478.25
4.4.30.0070.0108.25
4.4.20.0030.0378.25
4.4.10.0000.0308.25
4.4.00.0030.0408.25
4.3.110.0070.0308.25
4.3.100.0030.0378.25
4.3.90.0030.0308.25
4.3.80.0000.0308.25
4.3.70.0000.0178.25
4.3.60.0030.0338.25
4.3.50.0100.0278.25
4.3.40.0070.0508.25
4.3.30.0000.0208.25
4.3.20.0030.0338.25
4.3.10.0000.0408.25
4.3.00.0030.0338.25