3v4l.org

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

VersionSystem time (s)User time (s)Memory (MiB)
7.4.00.0040.01414.67
7.3.120.0060.01214.82
7.3.110.0070.01014.88
7.3.100.0040.01414.90
7.3.90.0040.01214.87
7.3.80.0060.00914.63
7.3.70.0030.01014.60
7.3.60.0030.01014.86
7.3.50.0030.01215.06
7.3.40.0070.01014.89
7.3.30.0070.01014.83
7.3.20.0110.00416.42
7.3.10.0030.01016.58
7.3.00.0090.00316.48
7.2.250.0070.01315.33
7.2.240.0030.01714.86
7.2.230.0040.01115.37
7.2.220.0030.00614.89
7.2.210.0060.00914.68
7.2.200.0030.01315.16
7.2.190.0000.01215.14
7.2.180.0000.01614.89
7.2.170.0090.00314.98
7.2.160.0000.01515.05
7.2.150.0030.00916.96
7.2.140.0100.00017.09
7.2.130.0060.01016.70
7.2.120.0160.00316.70
7.2.110.0100.00717.02
7.2.100.0100.00716.69
7.2.90.0090.00916.75
7.2.80.0090.00616.57
7.2.70.0000.01416.78
7.2.60.0080.00816.93
7.2.50.0040.01416.92
7.2.40.0080.00616.91
7.2.30.0030.01416.73
7.2.20.0000.01516.80
7.2.10.0070.01116.90
7.2.00.0030.01118.24
7.1.330.0040.01115.71
7.1.320.0090.00915.74
7.1.310.0080.00815.79
7.1.300.0030.00915.56
7.1.290.0100.00315.69
7.1.280.0100.00015.98
7.1.270.0070.00415.82
7.1.260.0040.00715.93
7.1.250.0000.01616.04
7.1.70.0070.00017.30
7.1.60.0030.02019.70
7.1.50.0070.01017.11
7.1.00.0030.07722.44
7.0.200.0180.00414.98
7.0.140.0000.07722.04
7.0.60.0100.07319.88
7.0.50.0100.05717.87
7.0.40.0170.07320.40
7.0.30.0530.07720.16
7.0.20.0230.08320.12
7.0.10.0000.04720.11
7.0.00.0100.06720.20
5.6.280.0070.07021.14
5.6.210.0030.04020.52
5.6.200.0030.08318.16
5.6.190.0170.07320.33
5.6.180.0500.06720.47
5.6.170.0100.04720.50
5.6.160.0070.08720.49
5.6.150.0030.08318.21
5.6.140.0000.05718.18
5.6.130.0000.05018.14
5.6.120.0100.08020.75
5.6.110.0200.07021.00
5.6.100.0100.07321.00
5.6.90.0030.07021.00
5.6.80.0100.07720.42
5.5.350.0100.07020.45
5.5.340.0130.07717.96
5.5.330.0100.06320.57
5.5.320.0230.05720.24
5.5.310.0330.07020.56
5.5.300.0100.05318.06
5.5.290.0070.04018.01
5.5.280.0200.07020.81
5.5.270.0030.08720.86
5.5.260.0030.07720.98
5.5.250.0070.08320.69
5.5.240.0200.07320.17
5.4.450.0200.05019.44
5.4.440.0900.06719.60
5.4.430.1030.06319.38
5.4.420.1130.07019.38
5.4.410.0930.05019.42
5.4.400.1170.06319.06
5.4.390.1030.05019.28
5.4.380.0100.05718.59
5.4.370.0170.05018.80
5.4.360.0070.05718.71
5.4.350.0100.06718.50
5.4.340.0130.05318.75
5.4.320.0080.03612.52
5.4.310.0070.05012.51
5.4.300.0070.04012.52
5.4.290.0110.03612.51
5.4.280.0080.03612.41
5.4.270.0070.03812.40
5.4.260.0060.04012.41
5.4.250.0090.05112.40
5.4.240.0080.03512.41
5.4.230.0070.03712.40
5.4.220.0080.03612.40
5.4.210.0090.03412.40
5.4.200.0060.03912.40
5.4.190.0090.03312.39
5.4.180.0080.03512.39
5.4.170.0080.03612.41
5.4.160.0090.03712.40
5.4.150.0020.04112.39
5.4.140.0070.03612.08
5.4.130.0070.03412.07
5.4.120.0020.03912.02
5.4.110.0070.03412.02
5.4.100.0080.03512.02
5.4.90.0080.03812.02
5.4.80.0090.03512.02
5.4.70.0060.03712.02
5.4.60.0050.03612.02
5.4.50.0030.03812.02
5.4.40.0090.03212.00
5.4.30.0070.03612.00
5.4.20.0080.03512.00
5.4.10.0090.03112.00
5.4.00.0060.03711.49
5.3.290.0090.03812.80
5.3.280.0070.03712.71
5.3.270.0060.04012.73
5.3.260.0070.03812.72
5.3.250.0080.03612.72
5.3.240.0070.03612.72
5.3.230.0100.03512.71
5.3.220.0080.03712.68
5.3.210.0110.03412.68
5.3.200.0100.03312.68
5.3.190.0060.03812.68
5.3.180.0080.03612.68
5.3.170.0050.03812.67
5.3.160.0090.03512.67
5.3.150.0080.03812.68
5.3.140.0070.03812.66
5.3.130.0050.04112.66
5.3.120.0110.03412.65
5.3.110.0050.04012.66
5.3.100.0080.03712.14
5.3.90.0050.03812.13
5.3.80.0070.03512.11
5.3.70.0050.03812.11
5.3.60.0080.03512.10
5.3.50.0050.03612.04
5.3.40.0070.03612.04
5.3.30.0060.03612.01
5.3.20.0070.03411.79
5.3.10.0060.03511.75
5.3.00.0050.03811.73
5.2.170.0050.0319.24
5.2.160.0020.0339.24
5.2.150.0020.0339.24
5.2.140.0040.0319.24
5.2.130.0040.0309.20
5.2.120.0030.0319.20
5.2.110.0050.0299.21
5.2.100.0050.0299.20
5.2.90.0040.0309.20
5.2.80.0030.0329.20
5.2.70.0050.0319.20
5.2.60.0060.0299.14
5.2.50.0110.0259.11
5.2.40.0070.0279.09
5.2.30.0070.0309.07
5.2.20.0030.0309.06
5.2.10.0040.0288.99
5.2.00.0050.0288.85
5.1.60.0040.0258.13
5.1.50.0050.0258.13
5.1.40.0050.0268.11
5.1.30.0020.0288.46
5.1.20.0030.0288.48
5.1.10.0040.0268.21
5.1.00.0020.0288.21
5.0.50.0040.0206.70
5.0.40.0010.0226.55
5.0.30.0060.0286.37
5.0.20.0030.0196.35
5.0.10.0040.0196.33
5.0.00.0040.0316.32
4.4.90.0030.0154.78
4.4.80.0070.0134.75
4.4.70.0010.0184.75
4.4.60.0020.0174.75
4.4.50.0010.0174.77
4.4.40.0030.0254.71
4.4.30.0030.0154.75
4.4.20.0000.0184.85
4.4.10.0040.0144.85
4.4.00.0020.0264.76
4.3.110.0020.0174.67
4.3.100.0030.0174.66
4.3.90.0040.0134.64
4.3.80.0040.0234.61
4.3.70.0020.0154.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0020.0254.56
4.3.30.0000.0183.38
4.3.20.0030.0153.36
4.3.10.0030.0143.30
4.3.00.0030.01326.50

preferences:
42.85 ms | 401 KiB | 5 Q