3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Example { public function match(callable $cb) { echo $cb(); } } class Callee { public function yo() { return "If I show up, I'm allowed to do this!"; } } $ex = new Example(); $callee = new Callee(); $cases = [ [$callee, 'yo'], [$callee, ''], ]; $ex->match($cases[0]); $ex->match($cases[1]);
based on 2idHZ

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.0360.01216.88
7.2.00.0030.01019.29
7.1.200.0100.00315.77
7.1.100.0070.00718.16
7.1.70.0060.00317.29
7.1.60.0030.01519.50
7.1.50.0160.00617.07
7.1.00.0070.07022.32
7.0.200.0000.01016.81
7.0.60.0200.04719.98
7.0.50.0070.03717.88
7.0.40.0070.08319.96
7.0.30.0230.04720.17
7.0.20.0270.05720.12
7.0.10.0100.05320.26
7.0.00.0030.05320.06
5.6.280.0000.03721.08
5.6.210.0170.06720.70
5.6.200.0070.08318.27
5.6.190.0100.03720.62
5.6.180.0170.03720.61
5.6.170.0500.06020.48
5.6.160.0030.08720.54
5.6.150.0030.04018.23
5.6.140.0030.05018.23
5.6.130.0070.09018.18
5.6.120.0100.08320.98
5.6.110.0170.07321.18
5.6.100.0030.07720.99
5.6.90.0070.03721.09
5.6.80.0070.07320.54
5.5.350.0230.08020.40
5.5.340.0070.07718.09
5.5.330.0030.05020.31
5.5.320.0300.06720.29
5.5.310.0270.08020.27
5.5.300.0030.04317.94
5.5.290.0070.04717.92
5.5.280.0100.06320.77
5.5.270.0170.07320.76
5.5.260.0070.03720.98
5.5.250.0070.04320.46
5.5.240.0300.06720.16
5.4.450.0130.04319.29
5.4.440.0270.07319.55
5.4.430.0170.04719.57
5.4.420.0300.06719.54
5.4.410.0270.06719.34
5.4.400.0170.03718.92
5.4.390.0170.04319.00
5.4.380.0230.07319.19
5.4.370.0130.04718.96
5.4.360.0130.05019.17
5.4.350.0270.04719.21
5.4.340.0170.05719.09
5.4.320.0130.04019.17
5.4.310.0200.04318.93
5.4.300.0230.05019.15
5.4.290.0230.07019.18
5.4.280.0230.04319.21
5.4.270.0200.05719.18
5.4.260.0230.07318.96
5.4.250.0200.07718.92
5.4.240.0270.06019.21
5.4.230.0200.07719.03
5.4.220.0230.05719.16
5.4.210.0200.06018.95
5.4.200.0270.06318.92
5.4.190.0130.04019.13
5.4.180.0230.06718.95
5.4.170.0330.04319.11
5.4.160.0230.04019.19
5.4.150.0130.08018.93
5.4.140.0300.04716.44
5.4.130.0170.06316.45
5.4.120.0170.04716.39
5.4.110.0330.06016.52
5.4.100.0230.03316.53
5.4.90.0300.06316.54
5.3.290.0170.04314.67
5.3.280.0300.06314.59
5.3.270.0200.07314.65
5.3.260.0170.07714.67
5.3.250.0130.08314.64
5.3.240.0300.04314.64
5.3.230.0330.05714.62
5.3.220.0170.07014.64
5.3.210.0230.03014.49
5.3.200.0230.04714.64
5.3.190.0170.07314.63