3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function foo($a, $b) {} } function row($name, $t) { printf("%-40s %4.2s 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).

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0070.00716.45
7.3.00.0000.01416.79
7.2.130.0070.01017.07
7.2.120.0100.00316.78
7.2.110.0060.00916.98
7.2.100.0060.00617.04
7.2.90.0040.01217.03
7.2.80.0030.01016.95
7.2.70.0080.00417.05
7.2.60.0030.01216.62
7.2.50.0070.00716.92
7.2.40.0030.01316.83
7.2.30.0060.00616.92
7.2.20.0040.01116.87
7.2.10.0040.00816.64
7.2.00.0030.01218.06
7.1.250.0120.00315.65
7.1.70.0000.00717.32
7.1.60.0110.01519.70
7.1.50.0170.00717.07
7.1.00.0070.07722.54
7.0.200.0090.00614.82
7.0.140.0030.07321.92
7.0.60.0130.06720.10
7.0.50.0030.04717.88
7.0.40.0130.08020.24
7.0.30.0330.06020.15
7.0.20.0370.07020.07
7.0.10.0030.04720.25
7.0.00.0070.09320.03
5.6.280.0000.07721.04
5.6.210.0000.09020.70
5.6.200.0100.08018.27
5.6.190.0100.08320.52
5.6.180.4030.04020.54
5.6.170.0200.04720.59
5.6.160.0070.07720.61
5.6.150.0030.08318.15
5.6.140.0100.05318.27
5.6.130.0030.05018.18
5.6.120.0100.08020.98
5.6.110.0030.09321.11
5.6.100.0000.09320.99
5.6.90.0200.07321.12
5.6.80.0070.08020.37
5.6.70.4570.03320.51
5.5.350.0070.07320.39
5.5.340.0070.03317.96
5.5.330.0030.09320.47
5.5.320.3370.03720.33
5.5.310.0200.04320.19
5.5.300.0100.06317.95
5.5.290.0000.05317.95
5.5.280.0270.06720.70
5.5.270.0130.06720.80
5.5.260.0130.07720.74
5.5.250.0030.08020.70
5.5.240.0330.06320.05
5.4.450.0370.04028.29
5.4.440.0270.05328.28
5.4.430.0530.04728.28
5.4.420.0270.03728.28
5.4.410.0500.03728.28
5.4.400.0300.04027.71
5.4.390.0200.05027.24
5.4.380.0130.05718.58
5.4.370.0130.05718.77
5.4.360.0100.06718.51
5.4.350.0170.05018.78
5.4.340.0100.05718.70
5.4.320.0060.04212.51
5.4.310.0050.03912.51
5.4.300.0110.03212.52
5.4.290.0080.03612.51
5.4.280.0110.03212.41
5.4.270.0060.03812.40
5.4.260.0100.03612.40
5.4.250.0050.03912.41
5.4.240.0080.03412.40
5.4.230.0050.03912.40
5.4.220.0050.03812.40
5.4.210.0060.03612.40
5.4.200.0100.03412.39
5.4.190.0070.03512.39
5.4.180.0060.03612.39
5.4.170.0060.03812.40
5.4.160.0060.03612.40
5.4.150.0090.03312.39
5.4.140.0050.03812.08
5.4.130.0080.03312.07
5.4.120.0020.04112.03
5.4.110.0030.04012.02
5.4.100.0070.03312.02
5.4.90.0080.04312.02
5.4.80.0080.03512.02
5.4.70.0110.03012.02
5.4.60.0030.03812.02
5.4.50.0100.03512.02
5.4.40.0090.03212.00
5.4.30.0070.03312.00
5.4.20.0040.03612.00
5.4.10.0030.03712.00
5.4.00.0030.03811.50
5.3.290.0070.04212.80
5.3.280.0070.03712.71
5.3.270.0060.03912.72
5.3.260.0040.04012.72
5.3.250.0070.03612.71
5.3.240.0050.03812.72
5.3.230.0070.03812.71
5.3.220.0060.03712.68
5.3.210.0040.04112.68
5.3.200.0100.03412.68
5.3.190.0090.03612.68
5.3.180.0080.03512.67
5.3.170.0060.03712.67
5.3.160.0090.03412.68
5.3.150.0050.03912.67
5.3.140.0070.03712.66
5.3.130.0010.04412.66
5.3.120.0060.04012.66
5.3.110.0070.03912.66
5.3.100.0060.03812.14
5.3.90.0070.03612.13
5.3.80.0070.03512.11
5.3.70.0080.03612.11
5.3.60.0020.04112.09
5.3.50.0060.03612.05
5.3.40.0120.03212.05
5.3.30.0030.03912.00
5.3.20.0050.03711.79
5.3.10.0050.03511.75
5.3.00.0040.03811.73
5.2.170.0030.0329.24
5.2.160.0020.0329.24
5.2.150.0040.0319.24
5.2.140.0050.0319.24
5.2.130.0050.0299.19
5.2.120.0070.0269.20
5.2.110.0030.0319.21
5.2.100.0070.0269.20
5.2.90.0040.0309.20
5.2.80.0040.0309.20
5.2.70.0080.0279.20
5.2.60.0060.0299.14
5.2.50.0050.0309.11
5.2.40.0040.0309.09
5.2.30.0080.0259.07
5.2.20.0050.0299.07
5.2.10.0030.0328.98
5.2.00.0060.0308.84
5.1.60.0040.0248.13
5.1.50.0040.0258.12
5.1.40.0040.0248.10
5.1.30.0080.0238.45
5.1.20.0050.0278.47
5.1.10.0030.0278.21
5.1.00.0030.0288.20
5.0.50.0040.0206.69
5.0.40.0040.0196.55
5.0.30.0030.0336.36
5.0.20.0050.0186.35
5.0.10.0040.0206.32
5.0.00.0050.0316.31
4.4.90.0020.0174.78
4.4.80.0030.0194.75
4.4.70.0030.0214.75
4.4.60.0040.0164.76
4.4.50.0030.0164.77
4.4.40.0020.0274.71
4.4.30.0040.0144.76
4.4.20.0030.0154.84
4.4.10.0000.0194.85
4.4.00.0030.0254.75
4.3.110.0040.0144.67
4.3.100.0030.0154.66
4.3.90.0030.0144.63
4.3.80.0030.0244.61
4.3.70.0010.0174.63
4.3.60.0020.0164.63
4.3.50.0050.0184.63
4.3.40.0030.0284.56
4.3.30.0030.0153.36
4.3.20.0030.0153.35
4.3.10.0020.0163.30
4.3.00.0000.02026.73

preferences:
40.07 ms | 401 KiB | 5 Q