3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() {} } $foo = new Foo(); $method = 'bar'; $args = array(); $call_func_method = array($foo, $method); $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($call_func_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.4.10.0070.03315.14
7.4.00.0070.03415.20
7.3.130.0070.03414.74
7.3.120.0130.02614.79
7.3.110.0060.02314.82
7.3.100.0060.01914.73
7.3.90.0070.02214.80
7.3.80.0070.01615.05
7.3.70.0090.01914.62
7.3.60.0030.02114.86
7.3.50.0000.02714.72
7.3.40.0030.01914.80
7.3.30.0070.02214.84
7.3.20.0100.01916.59
7.3.10.0030.02316.71
7.3.00.0070.02016.38
7.2.260.0000.04315.17
7.2.250.0030.03814.77
7.2.240.0070.02314.93
7.2.230.0070.03315.04
7.2.220.0070.04015.13
7.2.210.0130.01715.19
7.2.200.0030.02515.24
7.2.190.0000.03015.25
7.2.180.0030.02614.96
7.2.170.0070.02314.98
7.2.160.0030.03015.13
7.2.150.0100.03516.96
7.2.140.0040.02116.99
7.2.130.0070.02317.03
7.2.120.0100.02016.82
7.2.110.0000.02516.92
7.2.100.0030.03016.70
7.2.90.0070.02016.85
7.2.80.0030.02316.92
7.2.70.0100.03617.05
7.2.60.0090.02216.73
7.2.50.0100.02116.80
7.2.40.0000.02516.81
7.2.30.0030.02717.02
7.2.20.0030.02616.89
7.2.10.0040.02517.09
7.2.00.0050.02217.98
7.1.330.0040.03915.71
7.1.320.0070.04715.71
7.1.310.0090.03515.71
7.1.300.0030.03515.79
7.1.290.0000.04315.92
7.1.280.0000.04115.96
7.1.270.0070.04615.51
7.1.260.0060.03215.82
7.1.250.0000.03715.88
7.1.240.0090.02815.94
7.1.230.0000.04015.91
7.1.220.0090.02815.78
7.1.210.0040.03915.69
7.1.200.0040.03615.88
7.1.190.0070.03715.77
7.1.180.0070.04115.92
7.1.170.0000.03815.96
7.1.160.0060.03515.79
7.1.150.0030.03315.80
7.1.140.0000.03515.80
7.1.130.0070.03615.74
7.1.120.0000.03616.01
7.1.110.0070.04016.02
7.1.100.0030.03515.88
7.1.90.0000.04315.75
7.1.80.0000.03715.95
7.1.70.0030.02916.57
7.1.60.0060.03917.70
7.1.50.0000.04016.35
7.1.40.0070.03316.03
7.1.30.0130.02915.84
7.1.20.0030.03815.70
7.1.10.0100.03115.67
7.1.00.0050.06419.07
7.0.330.0030.03015.26
7.0.320.0100.03015.22
7.0.310.0100.03215.32
7.0.300.0070.03415.30
7.0.290.0040.03615.45
7.0.280.0070.03415.32
7.0.270.0030.03515.41
7.0.260.0070.03315.47
7.0.250.0130.02915.26
7.0.240.0100.03215.41
7.0.230.0040.03615.41
7.0.220.0100.03015.29
7.0.210.0060.03115.50
7.0.200.0070.02515.94
7.0.190.0030.03515.61
7.0.180.0090.03515.58
7.0.170.0060.03515.49
7.0.160.0040.03215.44
7.0.150.0000.03615.58
7.0.140.0030.06518.74
7.0.130.0030.04515.37
7.0.120.0030.06518.79
7.0.110.0000.03715.57
7.0.100.0070.03015.23
7.0.90.0060.04215.43
7.0.80.0030.03915.26
7.0.70.0100.02615.68
7.0.60.0100.06417.75
7.0.50.0080.05116.69
7.0.40.0120.06116.84
7.0.30.0180.05716.84
7.0.20.0100.05616.91
7.0.10.0050.04616.96
7.0.00.0080.05416.85
5.6.400.0070.07214.13
5.6.390.0070.06614.38
5.6.380.0000.07414.27
5.6.370.0100.08214.26
5.6.360.0070.06914.60
5.6.350.0030.07314.22
5.6.340.0030.06714.25
5.6.330.0070.09314.11
5.6.320.0000.07514.32
5.6.310.0100.06314.43
5.6.300.0070.07014.46
5.6.290.0100.07214.20
5.6.280.0020.10417.71
5.6.270.0070.06714.47
5.6.260.0000.07814.64
5.6.250.0000.07914.48
5.6.240.0070.06914.32
5.6.230.0130.06214.45
5.6.220.0030.07214.35
5.6.210.0060.07517.46
5.6.200.0050.09416.21
5.6.190.0020.09117.54
5.6.180.1450.06717.48
5.6.170.0150.07317.60
5.6.160.0080.08517.49
5.6.150.0030.07416.28
5.6.140.0020.10716.22
5.6.130.0050.08516.32
5.6.120.0070.07417.67
5.6.110.0070.10317.52
5.6.100.0050.11017.86
5.6.90.0150.09117.73
5.6.80.0070.09717.37
5.6.70.2280.07917.24
5.6.60.0070.06714.15
5.6.50.0070.06614.54
5.6.40.0030.07614.18
5.6.30.0130.06114.22
5.6.20.0070.06314.14
5.6.10.0070.06914.14
5.6.00.0030.06614.45
5.5.380.0070.07014.27
5.5.370.0100.06914.39
5.5.360.0070.07514.35
5.5.350.0030.08817.31
5.5.340.0070.07016.13
5.5.330.0080.06917.39
5.5.320.0170.08417.24
5.5.310.0080.07517.50
5.5.300.0050.07816.19
5.5.290.0070.08716.19
5.5.280.0050.09917.48
5.5.270.0080.10517.47
5.5.260.0050.07817.67
5.5.250.0030.08517.43
5.5.240.0080.11017.28
5.5.230.0030.07014.15
5.5.220.0070.06513.91
5.5.210.0030.07814.25
5.5.200.0100.07614.43
5.5.190.0030.06814.10
5.5.180.0030.07114.04
5.5.170.0030.06814.29
5.5.160.0070.06914.32
5.5.150.0030.07114.36
5.5.140.0000.07314.49
5.5.130.0100.06514.08
5.5.120.0100.09114.11
5.5.110.0030.07614.28
5.5.100.0070.06114.14
5.5.90.0070.07614.24
5.5.80.0030.06614.29
5.5.70.0030.06614.36
5.5.60.0060.06213.81
5.5.50.0070.06313.95
5.5.40.0000.07514.48
5.5.30.0070.06114.29
5.5.20.0070.07414.00
5.5.10.0030.06714.24
5.5.00.0070.06914.18
5.4.450.0080.09916.29
5.4.440.0050.10416.43
5.4.430.0050.09316.29
5.4.420.0080.09416.44
5.4.410.0050.09916.37
5.4.400.0080.09316.28
5.4.390.0070.10116.28
5.4.380.0080.09816.16
5.4.370.0100.09316.21
5.4.360.0050.10216.28
5.4.350.0050.09316.14
5.4.340.0020.08516.23
5.4.330.0000.06913.41
5.4.320.0050.07316.28
5.4.310.0050.09916.32
5.4.300.0050.10716.13
5.4.290.0050.10616.28
5.4.280.0100.09416.30
5.4.270.0030.08716.28
5.4.260.0080.09316.23
5.4.250.0080.09616.18
5.4.240.0070.09916.16
5.4.230.0050.09816.13
5.4.220.0050.10016.26
5.4.210.0020.08416.32
5.4.200.0030.07316.31
5.4.190.0050.10216.19
5.4.180.0080.09316.32
5.4.170.0070.10116.28
5.4.160.0050.10116.31
5.4.150.0080.11016.27
5.4.140.0070.09314.91
5.4.130.0070.10814.90
5.4.120.0070.07514.86
5.4.110.0050.07414.88
5.4.100.0030.07614.87
5.4.90.0100.09814.96
5.4.80.0070.09614.85
5.4.70.0050.07714.90
5.4.60.0020.08114.88
5.4.50.0050.10114.96
5.4.40.0030.10115.02
5.4.30.0050.07714.93
5.4.20.0030.07614.90
5.4.10.0100.07114.92
5.4.00.0030.08414.58
5.3.290.0100.10714.55
5.3.280.0030.12714.60
5.3.270.0100.08714.55
5.3.260.0030.11714.66
5.3.250.0030.10014.64
5.3.240.0070.12714.59
5.3.230.0100.12314.61
5.3.220.0030.10014.56
5.3.210.0070.13314.62
5.3.200.0030.07714.62
5.3.190.0100.13014.63
5.3.180.0030.13314.48
5.3.170.0100.12314.48
5.3.160.0100.09014.72
5.3.150.0000.11714.61
5.3.140.0070.13314.71
5.3.130.0070.10714.47
5.3.120.0070.11314.59
5.3.110.0030.12014.60
5.3.100.0070.12714.04
5.3.90.0130.12014.04
5.3.80.0030.10014.04
5.3.70.0100.12314.07
5.3.60.0070.13314.07
5.3.50.0030.13014.01
5.3.40.0070.09713.99
5.3.30.0070.07013.95
5.3.20.0100.08013.74
5.3.10.0000.07313.74
5.3.00.0000.07313.79
5.2.170.0030.13711.18
5.2.160.0100.08711.15
5.2.150.0100.07311.31
5.2.140.0030.08011.20
5.2.130.0030.08011.25
5.2.120.0000.08311.26
5.2.110.0000.10711.16
5.2.100.0030.07711.08
5.2.90.0030.07711.11
5.2.80.0030.07711.07
5.2.70.0030.08011.06
5.2.60.0000.08011.12
5.2.50.0030.07311.07
5.2.40.0000.07711.05
5.2.30.0000.08310.97
5.2.20.0070.08310.95
5.2.10.0030.07310.82
5.2.00.0070.07710.77
5.1.60.0030.07010.06
5.1.50.0000.0709.96
5.1.40.0000.0709.96
5.1.30.0030.08010.39
5.1.20.0030.07010.36
5.1.10.0000.0709.97
5.1.00.0000.07010.02
5.0.50.0000.0938.52
5.0.40.0030.0938.44
5.0.30.0000.1038.38
5.0.20.0000.1078.19
5.0.10.0030.1008.27
5.0.00.0000.1338.33
4.4.90.0030.0138.08
4.4.80.0000.0178.08
4.4.70.0030.0138.08
4.4.60.0000.0178.08
4.4.50.0030.0138.08
4.4.40.0070.0208.08
4.4.30.0030.0138.08
4.4.20.0000.0178.08
4.4.10.0000.0178.08
4.4.00.0030.0238.08
4.3.110.0030.0138.08
4.3.100.0000.0208.08
4.3.90.0000.0178.08
4.3.80.0070.0508.08
4.3.70.0070.0108.08
4.3.60.0030.0138.08
4.3.50.0030.0138.08
4.3.40.0000.0338.08
4.3.30.0030.0338.08
4.3.20.0000.0408.08
4.3.10.0030.0338.08
4.3.00.0000.0338.08

preferences:
41.48 ms | 401 KiB | 5 Q