3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { const MA_CONST = 1; public function get1() { return self::MA_CONST; } public function get2() { return static::MA_CONST; } } class B extends A { const MA_CONST = 2; } $o = new B(); var_dump($o->get1()); var_dump($o->get2()); var_dump(B::MA_CONST);

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.0070.01016.87
7.2.00.0070.00719.27
7.1.200.0130.00015.63
7.1.100.0030.01018.07
7.1.70.0000.01017.07
7.1.60.0070.00417.14
7.1.50.1330.01732.78
7.1.40.1030.01732.37
7.1.30.1300.01732.46
7.1.20.1330.01032.25
7.1.10.0830.01014.38
7.1.00.0730.00714.59
7.0.200.0060.00316.68
7.0.190.2070.01014.39
7.0.180.1000.01014.12
7.0.170.1230.01314.32
7.0.160.1270.01314.12
7.0.150.0930.00714.34
7.0.140.0670.01714.12
7.0.130.0770.00314.32
7.0.120.0630.01314.44
7.0.110.0700.01314.19
7.0.100.0870.01314.25
7.0.90.0530.00714.24
7.0.80.0800.01014.30
7.0.70.0670.01314.44
7.0.60.0830.01014.26
7.0.50.0700.01714.33
7.0.40.0700.01714.41
7.0.30.0670.01014.35
7.0.20.0530.01014.43
7.0.10.0530.01014.29
7.0.00.0830.01014.53
hhvm-3.15.40.0730.25084.44
5.6.300.0130.07020.57
5.6.290.0030.07020.74
5.6.280.0200.05720.91
5.6.270.0230.04320.85
5.6.260.0130.06320.81
5.6.250.0170.06320.78
5.6.240.0100.08020.82
5.6.230.0130.06320.61
5.6.220.0100.07020.69
5.6.210.0170.07020.70
5.6.200.0000.09020.80
5.6.190.0230.08020.58
5.6.180.0100.06720.83
5.6.170.0130.05720.77
5.6.160.0130.06320.58
5.6.150.0130.06720.57
5.6.140.0170.06720.61
5.6.130.0100.07020.63
5.6.120.0200.07020.84
5.6.110.0100.07320.84
5.6.100.0100.08720.61
5.6.90.0100.06020.84
5.6.80.0200.07720.24
5.6.70.0170.07319.99
5.6.60.0070.06020.13
5.6.50.0070.06020.01
5.6.40.0200.07719.97
5.6.30.0170.05720.22
5.6.20.0030.09319.93
5.6.10.0100.05719.93
5.6.00.0030.07020.20