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(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.00.0030.04514.98
7.3.120.0160.01914.71
7.3.110.0060.04214.42
7.3.100.0070.02814.79
7.3.90.0030.02614.85
7.3.80.0100.03814.62
7.3.70.0100.03014.88
7.3.60.0000.03114.88
7.3.50.0030.04814.79
7.3.40.0070.04414.78
7.3.30.0060.02214.77
7.3.20.0100.02716.84
7.3.10.0100.02016.32
7.3.00.0070.02316.79
7.2.250.0070.05115.15
7.2.240.0070.04614.98
7.2.230.0030.02715.05
7.2.220.0030.03415.06
7.2.210.0100.03515.29
7.2.200.0070.02714.96
7.2.190.0030.03414.80
7.2.180.0070.04814.98
7.2.170.0070.02914.99
7.2.160.0040.02815.01
7.2.150.0100.02516.95
7.2.140.0030.02516.98
7.2.130.0070.02617.06
7.2.120.0070.02817.02
7.2.110.0000.03117.00
7.2.100.0100.02316.98
7.2.90.0030.02717.00
7.2.80.0030.03017.01
7.2.70.0100.02316.93
7.2.60.0070.02417.02
7.2.50.0000.02716.87
7.2.40.0100.02416.84
7.2.30.0060.02617.10
7.2.20.0060.02316.88
7.2.10.0060.02917.13
7.2.00.0060.03718.04
7.1.330.0130.04715.41
7.1.320.0100.05115.79
7.1.310.0070.04316.14
7.1.300.0100.05515.77
7.1.290.0100.05215.61
7.1.280.0070.04015.99
7.1.270.0000.04915.52
7.1.260.0160.03215.88
7.1.250.0070.04015.83
7.1.240.0000.04815.54
7.1.230.0100.03615.86
7.1.220.0070.04015.96
7.1.210.0100.03915.90
7.1.200.0070.03915.90
7.1.190.0060.04415.61
7.1.180.0000.04515.66
7.1.170.0090.03115.87
7.1.160.0070.04315.75
7.1.150.0070.03815.96
7.1.140.0070.04115.96
7.1.130.0030.03715.79
7.1.120.0030.04415.77
7.1.110.0030.04215.57
7.1.100.0140.03815.68
7.1.90.0030.04415.71
7.1.80.0030.04815.89
7.1.70.0050.03216.57
7.1.60.0130.03917.41
7.1.50.0070.04516.20
7.1.40.0030.04115.84
7.1.30.0060.04115.51
7.1.20.0000.04715.63
7.1.10.0030.04015.84
7.1.00.0050.05119.07
7.0.330.0030.04615.48
7.0.320.0000.04815.21
7.0.310.0030.04115.63
7.0.300.0000.04615.57
7.0.290.0070.04015.46
7.0.280.0070.03415.57
7.0.270.0130.03815.60
7.0.260.0030.04015.44
7.0.250.0070.04015.39
7.0.240.0030.04215.41
7.0.230.0030.04715.21
7.0.220.0070.04015.52
7.0.210.0070.04115.55
7.0.200.0270.03115.93
7.0.190.0070.03715.26
7.0.180.0070.03915.50
7.0.170.0100.03515.50
7.0.160.0030.04115.63
7.0.150.0030.04415.28
7.0.140.0050.07318.74
7.0.130.0030.04615.14
7.0.120.0070.04215.59
7.0.110.0030.04515.29
7.0.100.0060.04115.45
7.0.90.0070.04315.57
7.0.80.0130.03315.55
7.0.70.0030.07218.74
7.0.60.0030.07618.54
7.0.50.0020.07418.75
7.0.40.0080.06816.69
7.0.30.0080.07416.83
7.0.20.0060.05116.70
7.0.10.0030.06316.67
7.0.00.0000.07616.81
5.6.400.0070.10114.37
5.6.390.0030.09314.38
5.6.380.0030.09514.45
5.6.370.0030.09514.08
5.6.360.0070.10214.07
5.6.350.0030.08914.31
5.6.340.0030.10514.44
5.6.330.0100.08614.38
5.6.320.0030.09414.11
5.6.310.0030.09814.24
5.6.300.0100.08714.41
5.6.290.0070.09014.66
5.6.280.0070.11817.86
5.6.270.0030.09314.10
5.6.260.0030.09014.28
5.6.250.0000.09814.11
5.6.240.0100.09914.21
5.6.230.0030.09114.29
5.6.220.0050.11917.53
5.6.210.0070.11817.35
5.6.200.0070.12117.61
5.6.190.0070.11117.68
5.6.180.0100.12317.60
5.6.170.0030.10917.56
5.6.160.0050.13117.63
5.6.150.0130.13217.80
5.6.140.0030.12717.57
5.6.130.0030.10017.71
5.6.120.0030.12717.57
5.6.110.0020.10317.59
5.6.100.0030.12517.71
5.6.90.0050.12517.87
5.6.80.0120.13117.39
5.6.70.0030.13417.30
5.6.60.0050.09717.36
5.6.50.0050.11617.32
5.6.40.0070.13017.28
5.6.30.0030.13417.36
5.6.20.0030.11317.47
5.6.10.0100.11617.23
5.6.00.0070.12517.42
5.5.380.0030.09214.32
5.5.370.0070.08814.36
5.5.360.0110.11917.40
5.5.350.0100.13317.46
5.5.340.0030.12217.47
5.5.330.0080.11017.44
5.5.320.0050.10117.70
5.5.310.0080.13117.56
5.5.300.0050.12617.60
5.5.290.0050.10017.60
5.5.280.0020.12917.65
5.5.270.0100.11717.59
5.5.260.0020.12217.46
5.5.250.0050.11817.31
5.5.240.0120.11417.12
5.5.230.0020.13117.15
5.5.220.0070.10717.26
5.5.210.0050.09917.16
5.5.200.0080.12917.32
5.5.190.0070.12417.29
5.5.180.0050.14417.25
5.5.170.0070.10714.06
5.5.160.0030.12417.25
5.5.150.0030.09917.21
5.5.140.0080.10117.35
5.5.130.0100.10817.12
5.5.120.0020.13017.25
5.5.110.0030.12517.21
5.5.100.0080.10317.33
5.5.90.0030.13217.04
5.5.80.0050.12517.04
5.5.70.0050.12817.24
5.5.60.0030.10017.04
5.5.50.0100.10316.97
5.5.40.0100.10617.21
5.5.30.0050.12017.33
5.5.20.0050.11817.19
5.5.10.0000.09617.03
5.5.00.0080.09816.95
5.4.450.0050.11615.36
5.4.440.0050.13315.54
5.4.430.0020.12715.35
5.4.420.0030.12815.44
5.4.410.0020.10415.38
5.4.400.0080.11615.21
5.4.390.0070.11415.31
5.4.380.0030.11915.19
5.4.370.0020.10315.32
5.4.360.0050.09015.33
5.4.350.0030.12215.28
5.4.340.0070.13515.21
5.4.330.0000.13911.51
5.4.320.0020.12315.23
5.4.310.0030.12415.34
5.4.300.0030.12715.18
5.4.290.0020.12115.27
5.4.280.0050.13515.30
5.4.270.0100.12215.32
5.4.260.0020.12215.20
5.4.250.0050.14515.23
5.4.240.0080.12415.32
5.4.230.0080.11715.33
5.4.220.0100.11415.20
5.4.210.0050.12215.36
5.4.200.0020.11315.19
5.4.190.0030.12215.31
5.4.180.0030.09515.27
5.4.170.0020.09515.34
5.4.160.0000.14115.32
5.4.150.0080.09215.31
5.4.140.0020.09213.93
5.4.130.0050.08714.00
5.4.120.0000.10014.00
5.4.110.0050.10414.02
5.4.100.0030.09713.99
5.4.90.0030.10813.95
5.4.80.0020.09013.93
5.4.70.0030.08813.92
5.4.60.0070.08013.88
5.4.50.0050.08313.98
5.4.40.0000.10414.00
5.4.30.0050.09013.99
5.4.20.0030.10113.89
5.4.10.0020.13513.99
5.4.00.0020.12513.65
5.3.290.0030.13713.05
5.3.280.0050.14013.04
5.3.270.0050.12613.02
5.3.260.0030.10713.06
5.3.250.0000.12513.09
5.3.240.0070.13513.05
5.3.230.0030.10113.13
5.3.220.0100.09913.07
5.3.210.0020.10413.07
5.3.200.0050.10213.06
5.3.190.0020.10113.06
5.3.180.0020.12113.01
5.3.170.0050.10613.08
5.3.160.0000.10413.03
5.3.150.0020.10213.08
5.3.140.0030.11012.99
5.3.130.0050.11313.06
5.3.120.0020.11113.08
5.3.110.0050.13613.06
5.3.100.0030.10512.78
5.3.90.0050.13212.76
5.3.80.0020.13712.72
5.3.70.0020.13512.79
5.3.60.0030.12312.77
5.3.50.0020.13312.80
5.3.40.0030.13812.69
5.3.30.0050.13312.65
5.3.20.0020.15112.63
5.3.10.0030.13312.59
5.3.00.0030.12912.59
5.2.170.0070.17712.53
5.2.160.0000.19012.53
5.2.150.0030.16712.53
5.2.140.0000.16312.53
5.2.130.0000.13712.53
5.2.120.0100.16012.53
5.2.110.0000.16712.53
5.2.100.0000.16712.53
5.2.90.0030.12012.53
5.2.80.0100.10712.53
5.2.70.0000.17712.53
5.2.60.0000.11312.53
5.2.50.0030.19012.53
5.2.40.0000.16312.53
5.2.30.0030.17712.53
5.2.20.0030.16012.53
5.2.10.0100.19012.53
5.2.00.0030.11712.53
5.1.60.0030.14712.53
5.1.50.0170.17012.53
5.1.40.0000.16012.53
5.1.30.0030.17312.53
5.1.20.0030.17312.53
5.1.10.0030.15012.53
5.1.00.0000.17712.53
5.0.50.0000.19312.53
5.0.40.0030.21012.53
5.0.30.0000.20312.53
5.0.20.0030.22012.53
5.0.10.0000.17012.53
5.0.00.0070.16312.53
4.4.90.0030.03712.53
4.4.80.0000.02012.53
4.4.70.0000.01712.53
4.4.60.0000.03012.53
4.4.50.0030.02312.53
4.4.40.0000.05312.53
4.4.30.0000.03712.53
4.4.20.0000.03712.53
4.4.10.0030.03312.53
4.4.00.0000.06012.53
4.3.110.0100.02712.53
4.3.100.0070.03012.53
4.3.90.0030.03312.53
4.3.80.0030.04712.53
4.3.70.0000.03312.53
4.3.60.0000.02712.53
4.3.50.0000.03712.53
4.3.40.0070.06012.53
4.3.30.0030.02712.53
4.3.20.0000.02712.53
4.3.10.0030.03312.53
4.3.00.0030.03312.53

preferences:
37.1 ms | 401 KiB | 5 Q