3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function foo($a, $b) {} } function row($name, $t) { echo $name.': '.round((microtime(true)-$t)*1e5, 2)." x 10 µs\n"; } $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.2.110.0090.00616.57
7.2.100.0070.01016.82
7.2.90.0080.00816.70
7.2.80.0040.01116.67
7.2.70.0060.01216.84
7.2.60.0100.00316.54
7.2.50.0090.00916.94
7.2.40.0000.01416.70
7.2.30.0030.01216.93
7.2.20.0030.01316.77
7.2.10.0070.01017.07
7.2.00.0050.00918.17
7.1.230.0040.00815.59
7.1.220.0060.00915.85
7.1.210.0070.00715.71
7.1.200.0070.00715.98
7.1.190.0030.01015.86
7.1.180.0140.00015.94
7.1.170.0080.00615.96
7.1.160.0030.01015.60
7.1.150.0000.01415.73
7.1.140.0030.00615.56
7.1.130.0070.01015.93
7.1.120.0040.01115.79
7.1.110.0110.00415.81
7.1.100.0030.01015.95
7.1.90.0030.00615.80
7.1.80.0030.00915.82
7.1.70.0090.00216.35
7.1.60.0110.01017.81
7.1.50.0110.01116.43
7.1.40.0030.01416.03
7.1.30.0140.00015.86
7.1.20.0130.00315.94
7.1.10.0000.00615.50
7.1.00.0020.04418.90
7.0.310.0080.00415.48
7.0.300.0040.01215.57
7.0.290.0000.01015.24
7.0.280.0000.01415.50
7.0.270.0070.00715.24
7.0.260.0100.00315.40
7.0.250.0070.00715.46
7.0.240.0030.01015.29
7.0.230.0050.00515.28
7.0.220.0000.01215.55
7.0.210.0000.01415.61
7.0.200.0040.00615.98
7.0.190.0000.00815.54
7.0.180.0100.00315.62
7.0.170.0000.01015.50
7.0.160.0110.00415.47
7.0.150.0060.00315.33
7.0.140.0080.03818.59
7.0.130.0040.00415.37
7.0.120.0060.00615.50
7.0.110.0110.00015.54
7.0.100.0050.00515.55
7.0.90.0120.00315.53
7.0.80.0110.00415.39
7.0.70.0070.00715.59
7.0.60.0060.04617.63
7.0.50.0050.02816.76
7.0.40.0070.04316.83
7.0.30.0270.04716.87
7.0.20.0130.02716.92
7.0.10.0080.03016.74
7.0.00.0100.02316.88
5.6.380.0060.00314.12
5.6.370.0070.01014.56
5.6.360.0030.01214.47
5.6.350.0110.00014.38
5.6.340.0040.00714.46
5.6.330.0130.00014.37
5.6.320.0000.00814.28
5.6.310.0120.00014.47
5.6.300.0070.00714.37
5.6.290.0070.00714.67
5.6.280.0050.03817.70
5.6.270.0070.00714.12
5.6.260.0080.00814.47
5.6.250.0000.01414.31
5.6.240.0070.00714.49
5.6.230.0000.01314.41
5.6.220.0090.00614.45
5.6.210.0090.04217.34
5.6.200.0050.04016.34
5.6.190.0070.03817.34
5.6.180.2080.02517.48
5.6.170.0180.04017.37
5.6.160.0050.03317.49
5.6.150.0090.04516.11
5.6.140.0050.02816.27
5.6.130.0020.04216.22
5.6.120.0070.04117.67
5.6.110.0060.04717.81
5.6.100.0130.01717.71
5.6.90.0110.02817.72
5.6.80.0020.03117.32
5.6.70.0020.04717.37
5.6.60.0030.00914.52
5.6.50.0080.00414.23
5.6.40.0130.00014.21
5.6.30.0120.00014.03
5.6.20.0000.01514.16
5.6.10.0120.00314.05
5.6.00.0040.00814.31
5.5.380.0060.00312.79
5.5.370.0000.00912.79
5.5.360.0060.00312.79
5.5.350.0120.03716.62
5.5.340.0060.02815.36
5.5.330.0020.02416.57
5.5.320.1790.02716.61
5.5.310.0120.02516.54
5.5.300.0050.04115.37
5.5.290.0030.04315.44
5.5.280.0050.04816.73
5.5.270.0030.05016.78
5.5.260.0080.02516.77
5.5.250.0040.02816.64
5.5.240.0150.04216.49
5.5.230.0000.01412.79
5.5.220.0000.01112.79
5.5.210.0060.00612.79
5.5.200.0060.00312.79
5.5.190.0050.00212.79
5.5.180.0030.00712.79
5.5.170.0070.01014.20
5.5.160.0000.01212.79
5.5.150.0090.00312.79
5.5.140.0060.00612.79
5.5.130.0030.00712.79
5.5.120.0030.00612.79
5.5.110.0030.00312.79
5.5.100.0040.00412.79
5.5.90.0030.00612.79
5.5.80.0030.00612.79
5.5.70.0000.01212.79
5.5.60.0060.00612.79
5.5.50.0000.01112.79
5.5.40.0000.00712.79
5.5.30.0190.00012.79
5.5.20.0050.00512.79
5.5.10.0110.00012.79
5.5.00.0180.00312.79
5.4.450.0200.03215.99
5.4.440.0200.03916.19
5.4.430.0200.04016.18
5.4.420.0200.03816.17
5.4.410.0280.03016.12
5.4.400.0190.02315.81
5.4.390.0190.03615.83
5.4.380.0150.02216.08
5.4.370.0200.03316.04
5.4.360.0200.03115.83
5.4.350.0130.02516.02
5.4.340.0170.02715.93
5.4.330.0030.00712.79
5.4.320.0180.02316.01
5.4.310.0170.02215.92
5.4.300.0220.02516.01
5.4.290.0120.04315.96
5.4.280.0160.02515.87
5.4.270.0180.04016.04
5.4.260.0190.02415.93
5.4.250.0170.03615.88
5.4.240.0180.03616.03
5.4.230.0150.03816.01
5.4.220.0200.03716.04
5.4.210.0180.04016.00
5.4.200.0170.04115.92
5.4.190.0170.02715.96
5.4.180.0230.03815.96
5.4.170.0280.03516.00
5.4.160.0200.02816.03
5.4.150.0200.02315.87
5.4.140.0190.02314.67
5.4.130.0180.03714.64
5.4.120.0180.02514.61
5.4.110.0190.03914.62
5.4.100.0250.02714.64
5.4.90.0200.02114.69
5.4.80.0230.03314.60
5.4.70.0250.03014.55
5.4.60.0170.02314.51
5.4.50.0250.03114.61
5.4.40.0260.02814.61
5.4.30.0240.02614.66
5.4.20.0180.02014.61
5.4.10.0160.02314.61
5.4.00.0210.01814.29
5.3.290.0130.04413.81
5.3.280.0190.01913.73
5.3.270.0220.03313.77
5.3.260.0190.02913.69
5.3.250.0170.04113.71
5.3.240.0240.03313.73
5.3.230.0210.03813.81
5.3.220.0180.02713.68
5.3.210.0190.03613.73
5.3.200.0250.03313.74
5.3.190.0200.03013.76
5.3.180.0210.03913.67
5.3.170.0180.03913.73
5.3.160.0220.03813.79
5.3.150.0220.03713.68
5.3.140.0160.01913.73
5.3.130.0170.04213.69
5.3.120.0160.03613.76
5.3.110.0200.02313.71
5.3.100.0180.04013.53
5.3.90.0150.04113.42
5.3.80.0180.04013.39
5.3.70.0210.03313.37
5.3.60.0200.03513.42
5.3.50.0260.02813.42
5.3.40.0190.03913.46
5.3.30.0230.03313.35
5.3.20.0220.03513.24
5.3.10.0250.02713.19
5.3.00.0200.03813.19
5.2.170.0170.02112.48
5.2.160.0130.01812.48
5.2.150.0190.02812.48
5.2.140.0170.02612.48
5.2.130.0170.03212.48
5.2.120.0160.01512.48
5.2.110.0220.02712.48
5.2.100.0130.03312.48
5.2.90.0130.03612.48
5.2.80.0210.03212.48
5.2.70.0170.03212.48
5.2.60.0170.02712.48
5.2.50.0150.03412.48
5.2.40.0160.03012.48
5.2.30.0180.03012.48
5.2.20.0130.03312.48
5.2.10.0220.01912.48
5.2.00.0210.02312.48
5.1.60.0140.02212.48
5.1.50.0160.02612.48
5.1.40.0170.02512.48
5.1.30.0160.02812.48
5.1.20.0260.01712.48
5.1.10.0170.01312.48
5.1.00.0170.02912.48
5.0.50.0060.02712.48
5.0.40.0100.02412.48
5.0.30.0070.02312.48
5.0.20.0080.02012.48
5.0.10.0110.01812.48
5.0.00.0090.03112.48
4.4.90.0090.01712.48
4.4.80.0100.01812.48
4.4.70.0090.02012.48
4.4.60.0050.01512.48
4.4.50.0100.01712.48
4.4.40.0050.02912.48
4.4.30.0090.01812.48
4.4.20.0120.01212.48
4.4.10.0080.01412.48
4.4.00.0070.02812.48
4.3.110.0090.01812.48
4.3.100.0100.01812.48
4.3.90.0040.01212.48
4.3.80.0080.01812.48
4.3.70.0110.01612.48
4.3.60.0130.01012.48
4.3.50.0080.01712.48
4.3.40.0080.02712.48
4.3.30.0080.01812.48
4.3.20.0050.01912.48
4.3.10.0030.01812.48
4.3.00.0060.01612.48

preferences:
61.84 ms | 401 KiB | 5 Q