3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() {} } $foo = new Foo(); $method = 'bar'; $args = array(); $iterations = 100000; $start = microtime(true); for($i = 0; $i < $iterations; $i++) { $foo->{$method}($args); } echo 'Calling directly on object: ' . (microtime(true) - $start) . PHP_EOL; $start = microtime(true); for($i = 0; $i < $iterations; $i++) { call_user_func(array($foo, $method), $args); } echo 'Calling call_user_func: ' . (microtime(true) - $start) . PHP_EOL;

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.00.0060.02519.49
7.1.70.0060.01817.09
7.1.60.0030.06019.29
7.1.50.0100.04016.68
7.1.00.0030.10722.44
7.0.200.0030.03716.63
7.0.140.0000.11022.09
7.0.80.0600.04720.05
7.0.70.0570.09719.91
7.0.60.0470.09719.96
7.0.50.0470.08720.29
7.0.40.0030.10720.07
7.0.30.0130.10020.09
7.0.20.0100.10720.04
7.0.10.0000.09020.09
7.0.00.0070.09720.07
5.6.280.0070.13721.00
5.6.230.0130.14720.64
5.6.220.0030.13720.53
5.6.210.0030.09020.62
5.6.200.0100.16020.96
5.6.190.0100.12021.04
5.6.180.0070.13321.13
5.6.170.0130.14021.09
5.6.160.0170.12721.04
5.6.150.0130.14020.96
5.6.140.0100.14020.93
5.6.130.0070.11021.00
5.6.120.0100.08721.12
5.6.110.0170.14021.10
5.6.100.0030.14321.12
5.6.90.0070.09021.01
5.6.80.0000.10720.39
5.6.70.0030.10320.32
5.6.60.0170.13020.30
5.6.50.0070.15020.50
5.6.40.0000.12320.46
5.6.30.0070.14320.30
5.6.20.0100.13720.44
5.6.10.0100.13320.49
5.6.00.0000.16020.33
5.5.370.0000.09320.46
5.5.360.0070.15720.33
5.5.350.0070.09020.42
5.5.340.0100.12020.88
5.5.330.0000.10320.80
5.5.320.0030.11320.83
5.5.310.0100.12720.89
5.5.300.0100.13720.93
5.5.290.0030.13320.89
5.5.280.0170.08720.60
5.5.270.0130.13720.90
5.5.260.0130.13020.82
5.5.250.0130.14320.62
5.5.240.0030.09020.16
5.5.230.0000.14020.30
5.5.220.0170.10720.13
5.5.210.0070.14720.28
5.5.200.0000.14320.13
5.5.190.0070.13720.23
5.5.180.0070.16020.13
5.5.160.0130.14020.13
5.5.150.0030.09020.12
5.5.140.0070.14020.14
5.5.130.0070.13320.08
5.5.120.0100.14720.25
5.5.110.0070.15020.25
5.5.100.0030.13020.16
5.5.90.0070.13019.95
5.5.80.0030.14020.07
5.5.70.0000.14320.02
5.5.60.0070.08720.05
5.5.50.0130.10319.95
5.5.40.0100.13719.90
5.5.30.0070.16020.07
5.5.20.0100.15720.14
5.5.10.0030.09019.98
5.5.00.0000.13720.05
5.4.450.0100.15719.35
5.4.440.0100.13719.17
5.4.430.0070.15019.53
5.4.420.0100.13719.35
5.4.410.0070.14719.10
5.4.400.0100.11719.05
5.4.390.0100.15019.04
5.4.380.0100.15019.23
5.4.370.0170.13719.19
5.4.360.0030.09019.21
5.4.350.0100.13319.12
5.4.340.0330.09719.16
5.4.320.0100.12319.12
5.4.310.0070.11319.12
5.4.300.0130.14019.20
5.4.290.0030.12318.84
5.4.280.0070.13319.02
5.4.270.0030.14019.04
5.4.260.0030.13719.20
5.4.250.0130.12718.84
5.4.240.0070.13019.04
5.4.230.0030.14018.84
5.4.220.0130.12319.17
5.4.210.0030.13719.02
5.4.200.0030.14018.84
5.4.190.0030.09318.86
5.4.180.0030.13019.20
5.4.170.0070.08719.21
5.4.160.0100.08319.18
5.4.150.0100.13319.19
5.4.140.0070.15016.34
5.4.130.0070.14716.42
5.4.120.0070.08316.42
5.4.110.0070.08316.42
5.4.100.0070.08716.43
5.4.90.0030.09716.42
5.4.80.0070.14016.32
5.4.70.0170.08716.33
5.4.60.0030.13316.32
5.4.50.0000.10716.44
5.4.40.0070.14316.54
5.4.30.0030.15016.30
5.4.20.0070.14316.36
5.4.10.0130.11716.46
5.4.00.0070.09315.79
5.3.290.0030.10714.65
5.3.280.0070.12014.71
5.3.270.0030.13014.61
5.3.260.0100.12714.61
5.3.250.0200.12714.62
5.3.240.0100.13014.55
5.3.230.0030.14314.68
5.3.220.0100.09714.54
5.3.210.0030.10314.56
5.3.200.0030.11314.55
5.3.190.0130.11314.57
5.3.180.0070.09714.55
5.3.170.0070.15014.55
5.3.160.0100.16014.67
5.3.150.0100.13314.64
5.3.140.0030.09314.61
5.3.130.0070.14014.49
5.3.120.0070.13014.58
5.3.110.0030.14014.68
5.3.100.0030.10314.14
5.3.90.0030.14014.07
5.3.80.0030.10014.07
5.3.70.0030.09713.99
5.3.60.0030.16314.11
5.3.50.0070.14014.00
5.3.40.0070.14313.87
5.3.30.0070.09313.91
5.3.20.0130.13313.74
5.3.10.0070.09313.68
5.3.00.0030.15313.69
5.2.170.0130.15311.73
5.2.160.0130.15711.73
5.2.150.0070.17011.73
5.2.140.0100.15311.73
5.2.130.0070.15011.73
5.2.120.0000.10711.73
5.2.110.0070.10311.73
5.2.100.0030.11011.73
5.2.90.0030.14011.73
5.2.80.0000.11011.73
5.2.70.0070.11711.73
5.2.60.0030.10711.73
5.2.50.0100.16711.73
5.2.40.0000.12011.73
5.2.30.0030.10711.73
5.2.20.0030.14011.73
5.2.10.0000.17711.73
5.2.00.0200.15311.73
5.1.60.0000.09711.73
5.1.50.0100.16311.73
5.1.40.0070.12711.73
5.1.30.0070.14011.73
5.1.20.0070.15011.73
5.1.10.0000.10711.73
5.1.00.0100.14011.73
5.0.50.0070.20711.73
5.0.40.0000.16011.73
5.0.30.0030.19711.73
5.0.20.0000.13011.73
5.0.10.0030.17011.73
5.0.00.0000.19011.73
4.4.90.0000.01711.73
4.4.80.0000.01711.73
4.4.70.0000.03711.73
4.4.60.0000.03711.73
4.4.50.0000.03711.73
4.4.40.0030.03011.73
4.4.30.0000.03711.73
4.4.20.0030.02011.73
4.4.10.0000.03711.73
4.4.00.0030.03711.73
4.3.110.0000.02711.73
4.3.100.0070.03011.73
4.3.90.0070.03011.73
4.3.80.0000.05311.73
4.3.70.0000.03011.73
4.3.60.0070.03311.73
4.3.50.0000.03711.73
4.3.40.0000.05311.73
4.3.30.0000.02011.73
4.3.20.0000.03711.73
4.3.10.0030.03311.73
4.3.00.0000.03711.73

preferences:
30.33 ms | 401 KiB | 5 Q