3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // SETUP CODE class A { function __construct($val) { $this->val = $val; } } $objs = [ new A(3), new A(5), new A(2), ]; // AMAZING max_by IMPL :P $res = array_reduce($objs, function ($c, $o) { $c = max($o->val, $c); return $o->val == $c ? $o->val : $c; }); var_dump($res);
based on FTc9G

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.00.0030.00919.30
7.1.100.0040.01118.20
7.1.70.0090.00617.19
7.1.60.0140.01019.34
7.1.50.0110.00717.02
7.1.00.0070.07322.37
7.0.200.0040.00716.45
7.0.140.0000.03722.09
7.0.60.0130.07319.97
7.0.50.0030.05717.88
7.0.40.0030.05320.14
7.0.30.0170.05320.20
7.0.20.0270.08020.33
7.0.10.0370.05320.23
7.0.00.0030.04020.14
5.6.280.0000.07320.79
5.6.210.0100.07320.76
5.6.200.0070.08718.18
5.6.190.0070.08020.39
5.6.180.0030.05720.50
5.6.170.0270.08020.50
5.6.160.0170.08320.54
5.6.150.0030.08018.19
5.6.140.0000.06318.18
5.6.130.0100.07318.21
5.6.120.0030.04021.03
5.6.110.0070.05020.90
5.6.100.0000.04721.12
5.6.90.0070.04321.09
5.6.80.0070.07720.36
5.6.70.3470.03720.52
5.5.350.0070.08320.41
5.5.340.0070.07017.98
5.5.330.0070.03720.39
5.5.320.0100.07720.31
5.5.310.0300.04320.35
5.5.300.0170.04718.07
5.5.290.0030.06317.96
5.5.280.0000.05720.90
5.5.270.0030.04320.80
5.5.260.0070.07320.73
5.5.250.0070.07720.71
5.5.240.0130.05020.08
5.4.450.0930.06319.51
5.4.440.0370.04319.41
5.4.430.0200.04319.27
5.4.420.0000.06319.48
5.4.410.0070.05719.26
5.4.400.0130.05719.03
5.4.390.0170.05719.09
5.4.380.0000.07019.09
5.4.370.0030.06319.02
5.4.360.0000.06319.06
5.4.350.0070.03912.03
5.4.340.0050.04312.02
5.4.320.0060.05012.51
5.4.310.0080.04312.50
5.4.300.0050.04212.51
5.4.290.0090.04012.50
5.4.280.0080.03812.39
5.4.270.0070.04212.39
5.4.260.0100.04212.40
5.4.250.0080.03912.40
5.4.240.0090.03412.40
5.4.230.0040.04112.39
5.4.220.0080.03412.39
5.4.210.0060.03712.39
5.4.200.0100.03512.39
5.4.190.0090.03812.39
5.4.180.0070.03812.39
5.4.170.0110.03912.40
5.4.160.0100.04312.39
5.4.150.0080.04812.39
5.4.140.0090.04512.08
5.4.130.0110.05012.06
5.4.120.0090.05212.02
5.4.110.0100.04112.02
5.4.100.0030.04512.02
5.4.90.0080.04512.02
5.4.80.0110.04512.02
5.4.70.0110.04512.01
5.4.60.0060.05012.01
5.4.50.0130.04412.01
5.4.40.0100.03712.00
5.4.30.0100.04612.00
5.4.20.0100.04612.00
5.4.10.0070.04912.00
5.4.00.0080.04811.49
5.3.290.0070.04712.80
5.3.280.0090.03812.71
5.3.270.0070.04112.73
5.3.260.0110.04112.72
5.3.250.0080.04112.72
5.3.240.0080.04012.72
5.3.230.0060.04212.71
5.3.220.0070.03812.68
5.3.210.0070.03912.68
5.3.200.0070.03612.68
5.3.190.0080.03712.68
5.3.180.0040.03912.68
5.3.170.0070.04012.67
5.3.160.0070.03712.67
5.3.150.0160.03812.67
5.3.140.0060.05112.66
5.3.130.0070.05712.66
5.3.120.0080.05312.66
5.3.110.0060.04712.66
5.3.100.0060.03812.12
5.3.90.0080.03812.10
5.3.80.0070.03812.09
5.3.70.0040.03912.09
5.3.60.0100.04412.08
5.3.50.0070.03712.03
5.3.40.0090.04312.03
5.3.30.0070.03711.98
5.3.20.0060.04011.77
5.3.10.0080.03811.73
5.3.00.0070.03711.73
5.2.170.0050.0349.22
5.2.160.0050.0319.22
5.2.150.0030.0339.22
5.2.140.0040.0319.21
5.2.130.0050.0319.18
5.2.120.0040.0359.18
5.2.110.0060.0329.19
5.2.100.0090.0379.18
5.2.90.0100.0369.18
5.2.80.0040.0429.17
5.2.70.0040.0379.17
5.2.60.0050.0339.13
5.2.50.0030.0369.10
5.2.40.0030.0319.07
5.2.30.0050.0309.05
5.2.20.0070.0279.04
5.2.10.0080.0418.95
5.2.00.0050.0408.81
5.1.60.0060.0328.09
5.1.50.0090.0298.09
5.1.40.0030.0278.07
5.1.30.0060.0258.42
5.1.20.0080.0238.44
5.1.10.0030.0278.16
5.1.00.0070.0258.17
5.0.50.0040.0236.64
5.0.40.0070.0176.50
5.0.30.0060.0316.32
5.0.20.0020.0236.28
5.0.10.0030.0246.26
5.0.00.0040.0296.25
4.4.90.0060.0134.77
4.4.80.0040.0174.76
4.4.70.0040.0174.75
4.4.60.0030.0174.76
4.4.50.0030.0194.77
4.4.40.0030.0274.71
4.4.30.0020.0164.76
4.4.20.0050.0144.84
4.4.10.0030.0194.85
4.4.00.0020.0314.76
4.3.110.0020.0174.67
4.3.100.0020.0184.66
4.3.90.0030.0164.63
4.3.80.0020.0284.59
4.3.70.0070.0134.63
4.3.60.0020.0154.63
4.3.50.0030.0164.63
4.3.40.0020.0254.54
4.3.30.0030.0153.30
4.3.20.0030.0153.28
4.3.10.0010.0173.24
4.3.00.0030.01713.38