3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function foo($a, $b) {} } function row($name, $t) { printf("%-40s %8s x 10 µs\n", $name, number_format((microtime(true)-$t)*1e5, 2)); } $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).

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0090.00616.70
7.3.00.0040.00716.61
7.2.130.0080.00316.96
7.2.120.0030.01516.96
7.2.110.0060.00916.69
7.2.100.0110.00416.62
7.2.90.0080.00417.01
7.2.80.0000.01416.79
7.2.70.0000.01417.03
7.2.60.0090.00616.75
7.2.50.0090.00317.15
7.2.40.0040.01116.70
7.2.30.0090.00616.89
7.2.20.0100.00317.02
7.2.10.0060.01216.95
7.2.00.0040.01018.28
7.1.250.0000.01515.78
7.1.70.0000.00717.08
7.1.60.0170.00719.70
7.1.50.0040.01516.85
7.1.00.0000.07722.43
7.0.200.0460.01016.55
7.0.140.0100.06721.95
7.0.60.0130.05319.88
7.0.50.0030.08717.90
7.0.40.0070.08720.04
7.0.30.0500.07720.11
7.0.20.0230.05320.25
7.0.10.0300.05720.21
7.0.00.0070.04320.16
5.6.280.0030.07320.79
5.6.210.0130.08320.66
5.6.200.0070.04018.18
5.6.190.0070.04720.61
5.6.180.0030.08320.56
5.6.170.0430.07720.55
5.6.160.0070.08720.61
5.6.150.0030.04318.28
5.6.140.0000.07718.26
5.6.130.0000.05318.28
5.6.120.0070.08020.98
5.6.110.0100.05721.00
5.6.100.0170.07721.04
5.6.90.0100.08321.01
5.6.80.0030.03720.39
5.6.70.4270.04320.52
5.5.350.0070.07020.41
5.5.340.0070.03717.97
5.5.330.0130.07320.31
5.5.320.0230.05020.41
5.5.310.0100.04320.24
5.5.300.0000.04318.05
5.5.290.0100.08317.98
5.5.280.0100.08720.79
5.5.270.0100.04320.89
5.5.260.0130.06320.89
5.5.250.0100.03320.70
5.5.240.0000.04020.21
5.4.450.0400.04328.29
5.4.440.0500.04328.28
5.4.430.0470.04328.28
5.4.420.0330.03328.28
5.4.410.0270.04028.28
5.4.400.0270.03727.55
5.4.390.0430.04326.89
5.4.380.0430.06018.54
5.4.370.0370.05018.61
5.4.360.0430.05318.80
5.4.350.0330.06018.85
5.4.340.0330.06318.73
5.4.320.0060.03912.52
5.4.310.0070.04112.52
5.4.300.0050.04312.52
5.4.290.0040.04012.52
5.4.280.0030.03912.41
5.4.270.0070.03612.42
5.4.260.0050.03812.41
5.4.250.0050.03812.41
5.4.240.0060.03712.41
5.4.230.0050.03812.41
5.4.220.0100.03112.40
5.4.210.0030.03912.40
5.4.200.0070.03712.41
5.4.190.0090.03412.41
5.4.180.0050.03712.40
5.4.170.0070.04012.41
5.4.160.0080.04112.41
5.4.150.0040.03912.40
5.4.140.0070.04312.08
5.4.130.0140.04612.07
5.4.120.0070.03812.04
5.4.110.0100.03212.02
5.4.100.0050.03912.03
5.4.90.0060.03912.03
5.4.80.0030.04112.03
5.4.70.0060.03612.03
5.4.60.0180.03112.02
5.4.50.0050.03812.02
5.4.40.0050.03612.01
5.4.30.0070.03512.01
5.4.20.0070.03512.01
5.4.10.0060.03612.01
5.4.00.0050.03911.50
5.3.290.0090.04012.80
5.3.280.0070.03912.71
5.3.270.0050.04112.72
5.3.260.0040.04312.72
5.3.250.0080.03712.72
5.3.240.0060.03812.72
5.3.230.0060.04012.71
5.3.220.0060.03712.68
5.3.210.0070.04112.68
5.3.200.0050.03812.68
5.3.190.0070.03912.68
5.3.180.0100.03512.67
5.3.170.0080.03812.68
5.3.160.0060.03712.68
5.3.150.0050.04212.67
5.3.140.0070.04912.66
5.3.130.0110.05312.66
5.3.120.0050.05612.66
5.3.110.0070.05312.66
5.3.100.0060.04912.14
5.3.90.0060.03812.13
5.3.80.0090.03512.12
5.3.70.0060.03612.12
5.3.60.0040.03912.10
5.3.50.0040.04012.05
5.3.40.0080.03612.05
5.3.30.0040.04112.02
5.3.20.0100.04011.79
5.3.10.0060.03411.75
5.3.00.0060.03511.73
5.2.170.0020.0349.25
5.2.160.0050.0309.26
5.2.150.0080.0379.26
5.2.140.0070.0319.25
5.2.130.0050.0409.21
5.2.120.0110.0279.21
5.2.110.0030.0349.22
5.2.100.0050.0299.21
5.2.90.0090.0259.21
5.2.80.0080.0279.21
5.2.70.0030.0319.21
5.2.60.0030.0329.16
5.2.50.0060.0309.13
5.2.40.0050.0359.11
5.2.30.0060.0289.09
5.2.20.0020.0359.08
5.2.10.0060.0279.00
5.2.00.0030.0348.87
5.1.60.0070.0248.14
5.1.50.0030.0298.14
5.1.40.0040.0278.12
5.1.30.0020.0298.48
5.1.20.0070.0298.49
5.1.10.0070.0368.22
5.1.00.0080.0338.22
5.0.50.0070.0276.71
5.0.40.0060.0226.57
5.0.30.0080.0426.38
5.0.20.0060.0246.36
5.0.10.0040.0276.34
5.0.00.0030.0426.33
4.4.90.0080.0184.78
4.4.80.0120.0144.75
4.4.70.0090.0194.75
4.4.60.0040.0204.76
4.4.50.0030.0204.77
4.4.40.0040.0254.71
4.4.30.0050.0154.76
4.4.20.0050.0174.84
4.4.10.0050.0214.85
4.4.00.0030.0324.76
4.3.110.0050.0174.66
4.3.100.0030.0154.67
4.3.90.0030.0154.63
4.3.80.0040.0244.63
4.3.70.0030.0194.63
4.3.60.0020.0194.63
4.3.50.0030.0184.63
4.3.40.0080.0224.57
4.3.30.0030.0163.37
4.3.20.0050.0143.35
4.3.10.0020.0183.30
4.3.00.0030.01726.16

preferences:
34.58 ms | 401 KiB | 5 Q