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.4.10.0100.04014.83
7.4.00.0030.04714.85
7.3.130.0100.02514.97
7.3.120.0050.02814.92
7.3.110.0050.03015.06
7.3.100.0080.02614.86
7.3.90.0050.02914.88
7.3.80.0070.02614.86
7.3.70.0050.03214.59
7.3.60.0080.02314.80
7.3.50.0070.02514.87
7.3.40.0070.02614.89
7.3.30.0080.02014.64
7.3.20.0080.01916.59
7.3.10.0060.02316.57
7.3.00.0090.02616.62
7.2.260.0030.05014.84
7.2.250.0130.04115.16
7.2.240.0060.02915.01
7.2.230.0020.03115.33
7.2.220.0070.03015.00
7.2.210.0030.03115.07
7.2.200.0080.02815.19
7.2.190.0030.03015.12
7.2.180.0050.03115.14
7.2.170.0080.02714.98
7.2.160.0050.02915.01
7.2.150.0050.03516.68
7.2.140.0080.03216.78
7.2.130.0060.03216.94
7.2.120.0080.02616.76
7.2.110.0050.03116.91
7.2.100.0080.02616.89
7.2.90.0050.02916.99
7.2.80.0070.03016.94
7.2.70.0060.02916.90
7.2.60.0060.03017.01
7.2.50.0070.02816.96
7.2.40.0090.02416.95
7.2.30.0040.03116.85
7.2.20.0040.03116.96
7.2.10.0040.03017.02
7.2.00.0080.02817.42
7.1.330.0050.04715.72
7.1.320.0060.05515.79
7.1.310.0070.04015.80
7.1.300.0030.05215.80
7.1.290.0050.04215.81
7.1.280.0030.04415.83
7.1.270.0080.03815.82
7.1.260.0070.04315.78
7.1.250.0040.04415.85
7.1.240.0030.04516.01
7.1.230.0020.04515.66
7.1.220.0030.04115.86
7.1.210.0050.04215.85
7.1.200.0080.04115.58
7.1.190.0030.04115.69
7.1.180.0060.03915.93
7.1.170.0050.04615.93
7.1.160.0050.04015.70
7.1.150.0050.04315.57
7.1.140.0050.04315.71
7.1.130.0070.04015.87
7.1.120.0100.04015.82
7.1.110.0020.04615.91
7.1.100.0060.04215.87
7.1.90.0050.04015.93
7.1.80.0070.04215.84
7.1.70.0030.03616.24
7.1.60.0060.05517.06
7.1.50.0040.04416.27
7.1.40.0050.04415.72
7.1.30.0070.04215.52
7.1.20.0030.04415.83
7.1.10.0080.04315.72
7.1.00.0030.05818.03
7.0.330.0030.04515.27
7.0.320.0070.04115.35
7.0.310.0070.04215.46
7.0.300.0030.04515.45
7.0.290.0050.04215.60
7.0.280.0050.04015.39
7.0.270.0030.04315.55
7.0.260.0050.04415.45
7.0.250.0030.04115.48
7.0.240.0050.04215.40
7.0.230.0080.03915.32
7.0.220.0070.04415.60
7.0.210.0050.04515.51
7.0.200.0020.04115.88
7.0.190.0050.04615.48
7.0.180.0050.04415.40
7.0.170.0070.03815.54
7.0.160.0090.03715.51
7.0.150.0080.03915.56
7.0.140.0030.07217.62
7.0.130.0030.04415.33
7.0.120.0080.04015.56
7.0.110.0070.04015.40
7.0.100.0050.04315.22
7.0.90.0080.04215.40
7.0.80.0030.04815.63
7.0.70.0090.05217.60
7.0.60.0080.05517.40
7.0.50.0050.06417.77
7.0.40.0060.05315.53
7.0.30.0060.06015.74
7.0.20.0040.06215.59
7.0.10.0020.06615.61
7.0.00.0080.06015.72
5.6.400.0100.07914.40
5.6.390.0030.09314.37
5.6.380.0080.08214.37
5.6.370.0070.08214.41
5.6.360.0030.08814.42
5.6.350.0020.08814.32
5.6.340.0030.09114.33
5.6.330.0050.07814.52
5.6.320.0050.08414.41
5.6.310.0080.08314.29
5.6.300.0050.09014.34
5.6.290.0070.09114.45
5.6.280.0070.10516.52
5.6.270.0050.08414.31
5.6.260.0000.08814.17
5.6.250.0050.08814.32
5.6.240.0080.08414.53
5.6.230.0020.08714.29
5.6.220.0040.10616.42
5.6.210.0030.10816.36
5.6.200.0080.10316.55
5.6.190.0000.10516.48
5.6.180.0060.11016.46
5.6.170.0070.10416.65
5.6.160.0040.11116.78
5.6.150.0030.10516.50
5.6.140.0040.10416.55
5.6.130.0110.10116.62
5.6.120.0030.10516.58
5.6.110.0010.11416.58
5.6.100.0040.10716.49
5.6.90.0040.10316.69
5.6.80.0030.10916.22
5.6.70.0020.10716.37
5.6.60.0090.09116.33
5.6.50.0040.08416.26
5.6.40.0060.08416.27
5.6.30.0070.08016.33
5.6.20.0010.09216.38
5.6.10.0080.09716.36
5.6.00.0040.08316.24
5.5.380.0030.09412.70
5.5.370.0000.10612.71
5.5.360.0090.10115.19
5.5.350.0030.10715.14
5.5.340.0080.10615.31
5.5.330.0040.10015.26
5.5.320.0060.11315.36
5.5.310.0030.11015.45
5.5.300.0070.10015.46
5.5.290.0060.09915.41
5.5.280.0040.10615.40
5.5.270.0040.10115.58
5.5.260.0030.10615.31
5.5.250.0010.09015.42
5.5.240.0080.10115.25
5.5.230.0030.10615.26
5.5.220.0010.10015.21
5.5.210.0020.08915.08
5.5.200.0050.07915.18
5.5.190.0010.08415.23
5.5.180.0040.08015.17
5.5.170.0050.08812.77
5.5.160.0040.09315.23
5.5.150.0070.08515.22
5.5.140.0020.08915.06
5.5.130.0050.08515.06
5.5.120.0080.07815.21
5.5.110.0050.07915.29
5.5.100.0040.08215.21
5.5.90.0070.07815.16
5.5.80.0010.08715.04
5.5.70.0010.08215.10
5.5.60.0030.08814.99
5.5.50.0030.10815.09
5.5.40.0020.10815.13
5.5.30.0030.11115.13
5.5.20.0030.10015.16
5.5.10.0040.08615.01
5.5.00.0100.10515.01
5.4.450.0070.10814.29
5.4.440.0080.10314.15
5.4.430.0020.10414.09
5.4.420.0080.10514.06
5.4.410.0040.11914.29
5.4.400.0030.10013.99
5.4.390.0030.10914.18
5.4.380.0060.09614.18
5.4.370.0030.08614.14
5.4.360.0030.08614.17
5.4.350.0000.09114.12
5.4.340.0010.08414.21
5.4.330.0030.09111.65
5.4.320.0070.09613.98
5.4.310.0020.08214.17
5.4.300.0010.08414.07
5.4.290.0020.07914.10
5.4.280.0030.08414.24
5.4.270.0000.08614.00
5.4.260.0040.08314.03
5.4.250.0020.09814.06
5.4.240.0070.08314.17
5.4.230.0020.10414.21
5.4.220.0060.09214.04
5.4.210.0000.09314.03
5.4.200.0040.09814.20
5.4.190.0010.11914.16
5.4.180.0030.09314.13
5.4.170.0010.10314.11
5.4.160.0030.11914.08
5.4.150.0010.10714.11
5.4.140.0050.10013.23
5.4.130.0020.10713.28
5.4.120.0020.11613.26
5.4.110.0030.10713.06
5.4.100.0040.10413.19
5.4.90.0040.10213.24
5.4.80.0030.11113.29
5.4.70.0020.10713.17
5.4.60.0070.10313.19
5.4.50.0020.11013.15
5.4.40.0030.11513.33
5.4.30.0040.08713.22
5.4.20.0030.10313.09
5.4.10.0040.09813.30
5.4.00.0010.10112.98
5.3.290.0010.09012.51
5.3.280.0030.09112.47
5.3.270.0010.10512.51
5.3.260.0010.11212.47
5.3.250.0030.11012.52
5.3.240.0010.11812.45
5.3.230.0020.11912.38
5.3.220.0040.11412.45
5.3.210.0010.11612.42
5.3.200.0030.11512.45
5.3.190.0010.11712.46
5.3.180.0010.11712.38
5.3.170.0030.12412.42
5.3.160.0020.11512.49
5.3.150.0040.11412.51
5.3.140.0020.10212.49
5.3.130.0010.10212.38
5.3.120.0020.09612.46
5.3.110.0010.10312.44
5.3.100.0030.11712.18
5.3.90.0060.11612.29
5.3.80.0010.12012.14
5.3.70.0040.10212.14
5.3.60.0060.11412.24
5.3.50.0040.11312.18
5.3.40.0050.10612.21
5.3.30.0040.11012.28
5.3.20.0010.11612.15
5.3.10.0070.10712.09
5.3.00.0060.11112.03
5.2.170.0020.12010.31
5.2.160.0020.12310.46
5.2.150.0020.11410.36
5.2.140.0050.13710.13
5.2.130.0030.13510.33
5.2.120.0070.13410.29
5.2.110.0000.14810.27
5.2.100.0000.14410.34
5.2.90.0000.12210.30
5.2.80.0030.14310.16
5.2.70.0020.13210.29
5.2.60.0020.14510.21
5.2.50.0080.13710.29
5.2.40.0030.14210.28
5.2.30.0030.14510.17
5.2.20.0050.12810.16
5.2.10.0030.13310.06
5.2.00.0050.1379.94
5.1.60.0050.1439.25
5.1.50.0050.1429.15
5.1.40.0030.1339.29
5.1.30.0020.1419.57
5.1.20.0070.1389.45
5.1.10.0050.1429.22
5.1.00.0020.1419.18
5.0.50.0020.1798.79
5.0.40.0030.1978.79
5.0.30.0070.1658.79
5.0.20.0020.1618.79
5.0.10.0020.1748.79
5.0.00.0100.1998.79
4.4.90.0030.0188.79
4.4.80.0050.0178.79
4.4.70.0000.0228.79
4.4.60.0030.0188.79
4.4.50.0030.0138.79
4.4.40.0000.0298.79
4.4.30.0030.0188.79
4.4.20.0020.0158.79
4.4.10.0010.0198.79
4.4.00.0020.0178.79
4.3.110.0020.0078.79
4.3.100.0020.0128.79
4.3.90.0010.0158.79
4.3.80.0020.0298.79
4.3.70.0010.0098.79
4.3.60.0040.0088.79
4.3.50.0000.0128.79
4.3.40.0020.0178.79
4.3.30.0000.0128.79
4.3.20.0020.0148.79
4.3.10.0020.0138.79
4.3.00.0000.0128.79

preferences:
28.77 ms | 401 KiB | 5 Q