3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function foo($a, $b) {} } function row($name, $t) { printf("%-50s: %01.2f x 10 ┬Ás\n", $name, (microtime(true)-$t)*1e5); } $max = 5*1e1; $object = new A; $t = microtime (true); for ($i=0; $i<$max; $i++) { $object->foo(1, 'foo'); } row($max.' x A::foo', $t); $t = microtime (true); for ($i=0; $i<$max; $i++) { call_user_func_array(array($object, 'foo'), array(1, 'foo')); } row($max.' x call_user_func_array', $t); $t = microtime (true); $ref = new ReflectionMethod($object, 'foo'); for ($i=0; $i<$max; $i++) { $ref->invokeArgs($object, array(1, 'foo')); } row($max.' x ReflectionMethod::invokeArgs', $t); $t = microtime (true); for ($j=0; $j<$max/10; $j++) { $ref = new ReflectionMethod($object, 'foo'); for ($i=0; $i<10; $i++) { $ref->invokeArgs($object, array(1, 'foo')); } } row(($max/10).' x (10 x ReflectionMethod::invokeArgs)', $t);

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.01019.10
7.1.70.0000.00817.21
7.1.60.0100.01319.70
7.1.50.0130.01017.09
7.1.00.0000.08022.57
7.0.200.0000.00815.11
7.0.140.0000.07721.92
7.0.60.0130.08019.95
7.0.50.0030.06317.88
7.0.40.0030.08720.11
7.0.30.0400.07320.15
7.0.20.0300.08020.03
7.0.10.0030.04720.33
7.0.00.0030.04720.17
5.6.280.0100.06721.10
5.6.210.0100.07320.54
5.6.200.0070.05018.21
5.6.190.0070.09020.51
5.6.180.3170.04020.55
5.6.170.0370.07020.59
5.6.160.0130.06320.54
5.6.150.0170.04318.21
5.6.140.0070.06018.17
5.6.130.0100.04718.28
5.6.120.0170.07321.04
5.6.110.0100.08021.11
5.6.100.0000.09021.04
5.6.90.0070.08720.89
5.6.80.0170.07020.39
5.6.70.4500.03720.29
5.5.350.0130.07720.30
5.5.340.0030.06718.05
5.5.330.0000.06320.31
5.5.320.3870.05020.31
5.5.310.0130.04720.35
5.5.300.0170.06317.93
5.5.290.0030.08717.98
5.5.280.0130.05320.70
5.5.270.0100.08020.77
5.5.260.0100.07020.81
5.5.250.0270.06320.79
5.5.240.0370.06020.20
5.4.450.0570.04728.29
5.4.440.0630.04728.29
5.4.430.0300.04728.28
5.4.420.0530.05728.28
5.4.410.0700.04728.28
5.4.400.0330.04727.68
5.4.390.0330.04727.24
5.4.380.0100.05718.78
5.4.370.0170.04718.80
5.4.360.0130.05018.78
5.4.350.0070.06318.71
5.4.340.0170.05318.75
5.4.320.0050.03612.52
5.4.310.0050.03912.51
5.4.300.0030.04612.51
5.4.290.0110.03912.51
5.4.280.0080.03612.41
5.4.270.0050.03912.41
5.4.260.0100.03612.41
5.4.250.0100.03812.40
5.4.240.0080.04212.40
5.4.230.0080.03912.40
5.4.220.0050.04112.40
5.4.210.0110.04812.40
5.4.200.0050.04612.40
5.4.190.0090.03612.39
5.4.180.0080.04412.39
5.4.170.0100.04912.40
5.4.160.0080.03912.39
5.4.150.0060.04312.39
5.4.140.0050.04312.08
5.4.130.0060.03712.07
5.4.120.0070.03612.03
5.4.110.0060.03812.02
5.4.100.0090.04912.02
5.4.90.0080.05212.02
5.4.80.0070.04712.02
5.4.70.0070.04012.02
5.4.60.0050.04212.02
5.4.50.0070.03612.02
5.4.40.0090.04212.00
5.4.30.0070.04512.00
5.4.20.0050.03912.00
5.4.10.0060.03912.00
5.4.00.0090.04111.49
5.3.290.0070.04212.80
5.3.280.0070.04112.71
5.3.270.0060.04712.72
5.3.260.0100.04612.72
5.3.250.0100.04212.72
5.3.240.0100.04112.72
5.3.230.0140.03912.71
5.3.220.0120.04712.68
5.3.210.0100.04912.68
5.3.200.0050.04412.68
5.3.190.0070.04512.68
5.3.180.0080.04112.67
5.3.170.0100.04412.67
5.3.160.0090.05712.67
5.3.150.0090.05512.68
5.3.140.0080.05412.66
5.3.130.0100.05412.66
5.3.120.0050.06012.66
5.3.110.0110.05712.65
5.3.100.0100.04512.14
5.3.90.0080.05012.12
5.3.80.0090.05012.11
5.3.70.0090.05112.11
5.3.60.0080.04912.10
5.3.50.0070.04512.05
5.3.40.0040.03912.04
5.3.30.0070.03812.01
5.3.20.0050.04411.79
5.3.10.0070.03811.75
5.3.00.0050.03811.73
5.2.170.0070.0359.24
5.2.160.0060.0429.24
5.2.150.0050.0319.24
5.2.140.0050.0369.24
5.2.130.0030.0329.20
5.2.120.0070.0269.20
5.2.110.0040.0309.21
5.2.100.0060.0399.20
5.2.90.0070.0409.20
5.2.80.0060.0439.19
5.2.70.0050.0369.20
5.2.60.0040.0329.15
5.2.50.0070.0309.11
5.2.40.0050.0299.09
5.2.30.0060.0319.07
5.2.20.0060.0289.06
5.2.10.0070.0328.99
5.2.00.0070.0298.85
5.1.60.0070.0218.13
5.1.50.0050.0248.13
5.1.40.0060.0258.11
5.1.30.0050.0278.46
5.1.20.0030.0308.48
5.1.10.0060.0258.21
5.1.00.0060.0288.21
5.0.50.0040.0246.70
5.0.40.0040.0186.55
5.0.30.0050.0376.37
5.0.20.0030.0216.35
5.0.10.0020.0236.33
5.0.00.0030.0326.32
4.4.90.0060.0134.78
4.4.80.0020.0174.75
4.4.70.0020.0184.75
4.4.60.0050.0144.75
4.4.50.0010.0194.77
4.4.40.0060.0234.71
4.4.30.0040.0214.76
4.4.20.0040.0154.84
4.4.10.0020.0174.85
4.4.00.0030.0264.75
4.3.110.0020.0184.67
4.3.100.0040.0154.66
4.3.90.0050.0124.64
4.3.80.0050.0314.61
4.3.70.0020.0174.63
4.3.60.0030.0154.62
4.3.50.0050.0144.63
4.3.40.0040.0234.56
4.3.30.0020.0203.37
4.3.20.0010.0173.35
4.3.10.0020.0163.31
4.3.00.0070.01326.73