3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { private function do_something (bool $str) { echo "private function"; } public function call_something(foo $obj) { $obj->do_something(true); } } class bar extends foo { public function do_something (bool $value) { echo "subclass"; } } $a = new foo(); $b = new bar(); $b->call_something($a); $method = new ReflectionMethod($a); $method->invoke($b, true);
based on C6fPG

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.0000.01516.85
7.2.00.0080.00819.59
7.1.200.0070.00715.58
7.1.100.0080.00817.97
7.1.70.0030.00717.15
7.1.60.0090.01619.44
7.1.50.0100.01416.86
7.1.00.0070.07322.32
7.0.200.0000.00816.79
7.0.60.0100.08020.04
7.0.50.0100.08317.90
7.0.40.0070.04320.13
7.0.30.0470.05320.37
7.0.20.0330.08020.18
7.0.10.0100.06020.08
7.0.00.0130.07720.03
5.6.280.0070.07321.09
5.6.210.0100.06320.59
5.6.200.0070.06318.12
5.6.190.0030.09320.55
5.6.180.0270.07020.77
5.6.170.0400.03320.57
5.6.160.0100.04020.46
5.6.150.0100.07718.16
5.6.140.0100.08018.23
5.6.130.0070.08018.28
5.6.120.0070.05721.13
5.6.110.0030.08720.98
5.6.100.0070.07021.14
5.6.90.0000.04720.98
5.6.80.0070.05320.44
5.5.350.0130.08020.41
5.5.340.0070.03717.96
5.5.330.0100.07720.28
5.5.320.0470.05020.35
5.5.310.0200.07020.24
5.5.300.0030.04317.95
5.5.290.0070.06318.07
5.5.280.0000.05020.74
5.5.270.0130.06320.77
5.5.260.0070.05320.74
5.5.250.0100.06320.70
5.5.240.4230.04020.29
5.4.450.0200.05019.18
5.4.440.0130.05319.17
5.4.430.0470.05019.43
5.4.420.0330.05719.46
5.4.410.0400.05019.34
5.4.400.0500.05019.27
5.4.390.0300.06019.01
5.4.380.0430.05719.27
5.4.370.0400.04719.25
5.4.360.0070.05319.12
5.4.350.0430.04719.49
5.4.340.0470.05318.85
5.4.320.0330.06719.14
5.4.310.0430.04319.25
5.4.300.0330.05319.09
5.4.290.0330.05718.98
5.4.280.0330.06019.24
5.4.270.0330.05719.20
5.4.260.0300.05319.21
5.4.250.0300.05719.14
5.4.240.0470.05018.86
5.4.230.0470.05019.19
5.4.220.0530.05019.13
5.4.210.0470.05319.11
5.4.200.0470.05019.49
5.4.190.0500.04719.11
5.4.180.0600.04019.48
5.4.170.0530.04319.04
5.4.160.0430.05318.99
5.4.150.0470.05319.27
5.4.140.0570.05316.39
5.4.130.0470.04716.36
5.4.120.0500.05316.59
5.4.110.0170.04716.25
5.4.100.0100.05016.68
5.3.290.0500.05014.57
5.3.280.0400.05014.82
5.3.270.0430.04714.53
5.3.260.0570.04314.48
5.3.250.0600.04314.66
5.3.240.0470.05014.69
5.3.230.0470.05314.51
5.3.220.0470.05014.79
5.3.210.0130.05014.56
5.3.200.0070.05714.62