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 . '<br />'; $start = microtime(true); for($i = 0; $i < $iterations; $i++) { call_user_func(array($foo, $method), $args); } echo 'Calling call_user_func: ' . microtime(true) - $start . '<br />';

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.0100.04014.64
7.3.120.0070.02714.67
7.3.110.0050.03714.82
7.3.100.0030.03014.84
7.3.90.0100.02414.83
7.3.80.0050.02714.90
7.3.70.0110.02114.83
7.3.60.0020.03014.86
7.3.50.0050.02714.74
7.3.40.0070.02514.68
7.3.30.0070.02514.82
7.3.20.0070.02516.66
7.3.10.0030.02816.71
7.3.00.0090.02316.60
7.2.250.0100.02615.12
7.2.240.0080.02915.14
7.2.230.0030.03415.02
7.2.220.0030.03015.15
7.2.210.0050.02915.16
7.2.200.0050.03115.16
7.2.190.0070.02415.10
7.2.180.0020.03415.07
7.2.170.0050.03315.12
7.2.160.0030.02715.13
7.2.150.0100.03517.05
7.2.140.0070.03016.96
7.2.130.0060.02916.97
7.2.120.0030.03116.72
7.2.110.0080.02416.83
7.2.100.0080.02716.99
7.2.90.0070.03117.11
7.2.80.0050.03116.72
7.2.70.0050.03216.87
7.2.60.0050.03216.94
7.2.50.0080.02817.03
7.2.40.0060.03017.04
7.2.30.0070.03016.86
7.2.20.0050.03616.72
7.2.10.0050.02816.99
7.2.00.0030.03116.96
7.1.330.0050.04315.79
7.1.320.0080.03715.87
7.1.310.0050.04515.77
7.1.300.0080.04315.86
7.1.290.0050.04415.55
7.1.280.0080.04015.70
7.1.270.0020.04715.74
7.1.260.0030.04715.73
7.1.250.0050.04815.88
7.1.70.0070.04617.21
7.1.60.0030.02717.23
7.1.50.0030.04417.08
7.1.00.0000.10722.36
7.0.200.0030.05016.62
7.0.140.0070.10322.09
7.0.120.0100.10022.16
7.0.60.0130.09020.06
7.0.50.0030.10717.89
7.0.40.0070.06720.26
7.0.30.0230.10020.34
7.0.20.0430.09320.10
7.0.10.0170.07320.15
7.0.00.0000.12020.41
5.6.280.0000.13721.02
5.6.210.0070.15320.50
5.6.200.0000.09318.23
5.6.190.0130.15020.57
5.6.180.0200.11720.67
5.6.170.0230.12020.51
5.6.160.0100.08720.61
5.6.150.0000.15718.17
5.6.140.0030.10018.28
5.6.130.0000.12718.18
5.6.120.0030.09720.97
5.6.110.0130.14320.96
5.6.100.0070.08320.97
5.6.90.0100.10320.99
5.6.80.0170.13320.51
5.6.70.4530.12720.52
5.5.350.0270.11320.38
5.5.340.0130.14018.09
5.5.330.0100.08020.32
5.5.320.0170.10720.31
5.5.310.0200.11020.34
5.5.300.0030.13018.00
5.5.290.0070.09718.06
5.5.280.0070.09720.72
5.5.270.0170.14320.75
5.5.260.0100.09020.89
5.5.250.0100.14720.66
5.5.240.0370.14020.16
5.4.450.2130.11319.58
5.4.440.2230.11719.41
5.4.430.2000.09019.39
5.4.420.1800.08319.54
5.4.410.2070.08319.27
5.4.400.1930.09018.84
5.4.390.1770.08319.08
5.4.380.2100.08019.09
5.4.370.1870.08719.00
5.4.360.2100.08319.22
5.4.350.2100.08719.16
5.4.340.1870.08719.19
5.4.320.1170.08719.21
5.4.310.0030.08018.98
5.4.300.0130.11018.87
5.4.290.1100.08719.07
5.4.280.2270.11319.19
5.4.270.1930.08318.83
5.4.260.1800.08018.98
5.4.250.2200.11719.18
5.4.240.1830.08019.19
5.4.230.2170.12319.21
5.4.220.1800.08318.83
5.4.210.1700.08018.98
5.4.200.0000.08319.05
5.4.190.0030.11719.06
5.4.180.0870.09019.12
5.4.170.1870.09319.15
5.4.160.1730.08018.96
5.4.150.2100.09319.21
5.4.140.2030.08316.67
5.4.130.2100.08016.30
5.4.120.2230.10716.49
5.4.110.2000.09016.16
5.4.100.2000.08716.36
5.4.90.1930.08716.35
5.4.80.2070.07716.49
5.4.70.2030.09016.54
5.4.60.1900.08016.53
5.4.50.2000.08316.16
5.4.40.2000.08316.51
5.4.30.1800.08016.34
5.4.20.1770.08016.54
5.4.10.1900.07716.48
5.4.00.1830.07315.76
5.3.290.2070.09314.64
5.3.280.2100.11714.50
5.3.270.2000.09314.61
5.3.260.2000.09314.51
5.3.250.1830.08314.50
5.3.240.1970.08714.75
5.3.230.1930.08314.60
5.3.220.2200.11314.62
5.3.210.1900.09014.54
5.3.200.2030.08714.71
5.3.190.2030.08714.54
5.3.180.2000.08714.66
5.3.170.2000.09314.57
5.3.160.1830.09014.61
5.3.150.0030.13714.46
5.3.140.0070.14314.63
5.3.130.0000.08714.62
5.3.120.1870.09014.66
5.3.110.2130.09014.45
5.3.100.2000.08714.04
5.3.90.2000.08714.09
5.3.80.2100.08713.94
5.3.70.1930.08314.24
5.3.60.1970.08013.93
5.3.50.1900.08713.95
5.3.40.1830.08713.92
5.3.30.1870.08713.99
5.3.20.2100.09713.81
5.3.10.1800.08713.53
5.3.00.1970.08313.87
5.2.170.1600.09011.10
5.2.160.1570.08711.25
5.2.150.1700.09311.20
5.2.140.1630.09711.10
5.2.130.1830.13011.18
5.2.120.1870.09711.01
5.2.110.1730.09311.00
5.2.100.1470.09011.00
5.2.90.1770.09011.11
5.2.80.1830.10011.15
5.2.70.1730.09311.01
5.2.60.1670.09311.05
5.2.50.1700.10011.03
5.2.40.1200.09010.97
5.2.30.1200.09311.10
5.2.20.1370.09311.07
5.2.10.1300.08710.77
5.2.00.1170.09710.67
5.1.60.1270.0879.93
5.1.50.1400.1279.89
5.1.40.1430.0909.95
5.1.30.0670.09310.34
5.1.20.0000.08310.32
5.1.10.0000.08310.12
5.1.00.0030.08010.00
5.0.50.0070.1108.49
5.0.40.0000.1138.55
5.0.30.0500.1138.36
5.0.20.0600.1078.36
5.0.10.0600.1078.32
5.0.00.0670.1138.32
4.4.90.0670.0178.32
4.4.80.0570.0178.32
4.4.70.0570.0178.32
4.4.60.0530.0208.32
4.4.50.0500.0138.32
4.4.40.0000.0408.32
4.4.30.0000.0208.32
4.4.20.0000.0178.32
4.4.10.0070.0138.32
4.4.00.0030.0308.32
4.3.110.0000.0178.32
4.3.100.0000.0178.32
4.3.90.0330.0138.32
4.3.80.0000.0238.32
4.3.70.0030.0178.32
4.3.60.0030.0138.32
4.3.50.0030.0108.32
4.3.40.0000.0238.32
4.3.30.0070.0138.32
4.3.20.0000.0138.32
4.3.10.0000.0238.32
4.3.00.0030.0178.32

preferences:
43.02 ms | 401 KiB | 5 Q