3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A{ private $stuff = 10; function test(){ return new class($this){ function __construct(A $s){ $this->s = $s; } function test(){ return $this->s->stuff; } }; } } $x = new A; $x->test()->test();
based on ZQ6ND

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.110.0120.00816.52
7.2.60.0130.00016.73
7.2.00.0030.00619.57
7.1.200.0060.00315.62
7.1.100.0000.01718.15
7.1.70.0070.00317.07
7.1.60.0070.01719.27
7.1.50.0100.01316.82
7.1.00.0070.07322.48
7.0.200.0220.00615.07
7.0.60.0130.04021.71
7.0.50.0100.06317.88
7.0.40.0170.08020.02
7.0.30.0130.04720.06
7.0.20.0130.04320.22
7.0.10.0100.08320.12
7.0.00.0070.05020.15
5.6.280.0070.05721.11
5.6.210.0100.08320.48
5.6.200.0100.07718.29
5.6.190.0100.05720.61
5.6.180.0300.05320.54
5.6.170.0130.04720.50
5.6.160.0100.06320.71
5.6.150.0100.04718.27
5.6.140.0070.07018.28
5.6.130.0070.07018.28
5.6.120.0070.06721.04
5.6.110.0200.06321.03
5.6.100.0230.06721.09
5.6.90.0100.05320.95
5.6.80.0000.07720.54
5.5.350.0300.03720.39
5.5.340.0100.06318.02
5.5.330.0100.05320.42
5.5.320.0200.04320.25
5.5.310.0270.06020.26
5.5.300.0030.04717.95
5.5.290.0200.07018.05
5.5.280.0000.04320.73
5.5.270.0000.05320.89
5.5.260.0070.04720.77
5.5.250.0100.08320.66
5.5.240.0100.04720.15
5.4.450.0200.06319.54
5.4.440.0170.05319.65
5.4.430.0970.04719.55
5.4.420.1030.04719.64
5.4.410.0700.05319.46
5.4.400.0730.04719.27
5.4.390.0730.05719.23
5.4.380.0700.05719.17
5.4.370.0830.05319.17
5.4.360.0930.04319.20
5.4.350.0970.05319.17
5.4.340.0970.05719.23
5.4.320.0070.05719.23
5.4.310.0630.06318.99
5.4.300.0770.06318.99
5.4.290.0930.05719.21
5.4.280.0070.05719.19
5.4.270.0470.04719.21
5.4.260.0730.04318.93
5.4.250.0770.05319.09
5.4.240.0700.05018.93
5.4.230.0730.06319.29
5.4.220.0270.05318.95
5.4.210.0270.04718.93
5.4.200.0200.05319.09
5.4.190.0230.05019.18
5.4.180.0270.04718.98
5.4.170.0200.05319.13
5.4.160.0270.04319.08
5.4.150.0170.06319.21
5.4.140.0130.05716.25
5.4.130.0270.04316.49
5.4.120.0230.05016.49
5.3.290.0630.06014.59
5.3.280.0200.04714.64
5.3.270.0230.05314.61
5.3.260.0100.06714.75
5.3.250.0100.06014.59
5.3.240.0430.04014.61
5.3.230.0330.03714.53
5.3.220.0170.05714.56