3v4l.org

run code in 300+ PHP versions simultaneously
<?php function userland_call_user_func(callable $function, ...$args) { if (! is_array($function)) { return $function(...$args); } $object = reset($function); if (is_object($object)) { return Closure::bind(function () use ($args, $function) { return $function(...$args); }, $object, get_class($object))->__invoke(); } return $function(...$args); } class Test { private function foo() { echo new Exception; } public function callFoo($callfunc) { $callfunc(array($this, 'foo')); } } $o = new Test; $o->callFoo('call_user_func'); $o->callFoo('userland_call_user_func');

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)
8.3.60.0110.00418.43
8.3.50.0110.01122.04
8.3.40.0170.00018.93
8.3.30.0070.00719.09
8.3.20.0070.00020.21
8.3.10.0060.00320.61
8.3.00.0000.00819.38
8.2.180.0070.00725.92
8.2.170.0070.00719.08
8.2.160.0140.00020.43
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00822.06
8.2.110.0080.00321.18
8.2.100.0070.00418.03
8.2.90.0080.00019.35
8.2.80.0040.00417.97
8.2.70.0090.00017.75
8.2.60.0080.00417.93
8.2.50.0060.00318.07
8.2.40.0080.00018.16
8.2.30.0050.00618.06
8.2.20.0040.00417.68
8.2.10.0040.00417.95
8.2.00.0070.00017.76
8.1.280.0060.00925.92
8.1.270.0080.00022.24
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00619.13
8.1.230.0080.00418.98
8.1.220.0030.00517.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.38
8.1.180.0000.00818.10
8.1.170.0000.01018.48
8.1.160.0030.00522.06
8.1.150.0050.00218.96
8.1.140.0050.00317.43
8.1.130.0060.00317.84
8.1.120.0000.00717.50
8.1.110.0000.00717.42
8.1.100.0030.00517.36
8.1.90.0000.00717.49
8.1.80.0000.00717.47
8.1.70.0030.00317.39
8.1.60.0030.00517.62
8.1.50.0000.00817.49
8.1.40.0040.00417.46
8.1.30.0040.00417.58
8.1.20.0040.00417.73
8.1.10.0000.00917.52
8.1.00.0030.00717.41
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0030.00318.44
8.0.270.0060.00316.89
8.0.260.0030.00317.32
8.0.250.0030.00316.94
8.0.240.0000.00717.05
8.0.230.0000.00717.03
8.0.220.0030.00316.95
8.0.210.0070.00016.87
8.0.200.0000.00616.98
8.0.190.0070.00017.00
8.0.180.0000.00816.99
8.0.170.0000.00816.89
8.0.160.0000.00716.96
8.0.150.0000.00716.96
8.0.140.0000.00916.80
8.0.130.0050.00313.39
8.0.120.0080.00016.96
8.0.110.0040.00416.88
8.0.100.0040.00416.83
8.0.90.0000.00716.87
8.0.80.0030.01816.95
8.0.70.0040.00416.82
8.0.60.0040.00416.87
8.0.50.0030.00516.78
8.0.30.0150.00617.13
8.0.20.0070.01217.40
8.0.10.0080.00016.88
8.0.00.0070.01116.63
7.4.330.0020.00215.00
7.4.320.0070.00016.61
7.4.300.0030.00316.46
7.4.290.0080.00016.41
7.4.280.0050.00216.52
7.4.270.0030.00516.56
7.4.260.0100.00016.49
7.4.250.0000.00716.53
7.4.240.0010.00616.62
7.4.230.0030.00316.46
7.4.220.0150.00816.63
7.4.210.0040.01116.54
7.4.200.0040.00416.64
7.4.160.0040.01316.56
7.4.150.0090.00917.40
7.4.140.0100.00717.86
7.4.130.0120.00816.53
7.4.120.0100.01016.48
7.4.110.0060.01516.47
7.4.100.0120.00416.52
7.4.90.0160.00616.41
7.4.80.0150.00919.39
7.4.70.0040.01716.66
7.4.60.0030.01316.59
7.4.50.0000.00816.34
7.4.40.0060.01216.45
7.4.30.0120.00916.54
7.4.00.0040.01115.10
7.3.330.0030.00313.32
7.3.320.0060.00013.36
7.3.310.0000.00716.36
7.3.300.0030.00316.38
7.3.290.0060.01216.30
7.3.280.0100.00716.36
7.3.270.0140.01117.40
7.3.260.0070.01116.41
7.3.250.0140.00316.41
7.3.240.0070.01516.42
7.3.230.0100.00716.39
7.3.210.0090.00916.39
7.3.200.0150.00719.39
7.3.190.0100.00716.45
7.3.180.0090.00616.48
7.3.170.0100.00716.34
7.3.160.0060.01216.45
7.3.00.0040.00816.22
7.2.330.0090.00916.83
7.2.320.0090.00916.71
7.2.310.0070.01716.80
7.2.300.0150.00716.81
7.2.290.0130.00316.67
7.2.130.0070.01017.05
7.2.120.0000.01617.05
7.2.110.0100.00716.99
7.2.100.0140.00716.95
7.2.90.0040.00817.15
7.2.80.0100.00716.95
7.2.70.0080.00816.80
7.2.60.0050.00317.02
7.2.50.0100.00816.79
7.2.40.0090.00616.96
7.2.30.0040.01416.92
7.2.20.0060.01316.77
7.2.10.0070.01116.92
7.2.00.0060.00916.79
7.1.250.0040.00815.75
7.1.240.0030.01315.51
7.1.230.0070.00315.61
7.1.220.0000.01115.56
7.1.210.0060.00615.63
7.1.200.0070.00415.85
7.1.190.0080.00815.49
7.1.180.0060.00615.79
7.1.170.0110.00415.84
7.1.160.0100.00315.73
7.1.150.0000.01415.86
7.1.140.0040.01215.87
7.1.130.0090.00615.84
7.1.120.0090.00315.88
7.1.110.0030.00915.50
7.1.100.0060.00615.87
7.1.90.0070.00715.79
7.1.80.0040.00715.59
7.1.70.0030.00616.31
7.1.60.0070.00816.18
7.1.50.0030.00916.38
7.1.40.0030.01415.85
7.1.30.0090.00315.72
7.1.20.0000.00915.77
7.1.10.0100.00315.61
7.1.00.0030.04419.12
7.0.330.0070.00815.39
7.0.320.0000.01515.23
7.0.310.0070.00715.14
7.0.300.0030.01015.18
7.0.290.0090.00315.50
7.0.280.0060.00615.47
7.0.270.0070.00715.53
7.0.260.0030.00615.30
7.0.250.0030.00615.23
7.0.240.0060.00615.61
7.0.230.0030.00615.18
7.0.220.0060.00615.40
7.0.210.0000.01315.16
7.0.200.0100.00316.15
7.0.190.0120.00315.48
7.0.180.0000.01515.39
7.0.170.0090.00315.38
7.0.160.0090.00615.13
7.0.150.0040.00415.09
7.0.140.0090.03518.81
7.0.130.0030.01015.41
7.0.120.0030.00615.04
7.0.110.0060.00615.23
7.0.100.0070.01015.16
7.0.90.0030.00615.53
7.0.80.0070.00715.42
7.0.70.0030.00915.38
7.0.60.0030.03217.66
7.0.50.0070.03716.77
7.0.40.0100.04216.69
7.0.30.0130.04016.78
7.0.20.0150.04316.62
7.0.10.0050.02916.85
7.0.00.0100.04416.94
5.6.380.0090.00614.45
5.6.370.0060.00614.11
5.6.360.0080.00814.20
5.6.350.0080.00814.56
5.6.340.0100.01014.16
5.6.330.0030.00914.11
5.6.320.0030.00914.21
5.6.310.0070.00414.59
5.6.300.0070.00414.31
5.6.290.0060.00314.37
5.6.280.0060.03617.70
5.6.270.0060.00614.40
5.6.260.0030.00914.20
5.6.250.0060.00614.30
5.6.240.0030.01014.36
5.6.230.0000.01114.11
5.6.220.0040.01214.06
5.6.210.0060.04617.46
5.6.200.0130.03716.22
5.6.190.0080.02517.30
5.6.180.2130.02017.21
5.6.170.0130.02917.39
5.6.160.0130.04117.37
5.6.150.0050.02516.26
5.6.140.0100.02816.16
5.6.130.0050.03816.28
5.6.120.0100.02017.54
5.6.110.0020.05217.68
5.6.100.0100.02017.54
5.6.90.0050.03617.54
5.6.80.0050.04817.28
5.6.70.0820.01817.10
5.6.60.0030.00614.11
5.6.50.0080.00314.09
5.6.40.0060.00614.02
5.6.30.0120.00314.31
5.6.20.0080.00414.34
5.6.10.0090.00614.23
5.6.00.0070.00714.30
5.5.380.0030.00912.93
5.5.370.0000.01312.93
5.5.360.0030.00912.93
5.5.350.0130.03716.62
5.5.340.0070.03815.44
5.5.330.0100.03516.68
5.5.320.0250.03516.64
5.5.310.0120.02416.65
5.5.300.0030.03815.45
5.5.290.0040.02915.50
5.5.280.0030.02716.90
5.5.270.0100.02816.93
5.5.260.0070.04016.84
5.5.250.0070.03216.81
5.5.240.0120.03816.54
5.5.230.0000.00812.93
5.5.220.0070.00412.93
5.5.210.0000.00912.93
5.5.200.0060.00312.93
5.5.190.0030.00312.93
5.5.180.0030.00612.93
5.5.170.0030.00612.93
5.5.160.0000.00812.93
5.5.150.0110.00412.93
5.5.140.0050.00512.93
5.5.130.0000.01212.93
5.5.120.0060.00912.93
5.5.110.0030.01012.93
5.5.100.0040.00812.93
5.5.90.0080.00812.93
5.5.80.0030.00312.93
5.5.70.0030.00612.93
5.5.60.0060.00812.93
5.5.50.0060.00312.93
5.5.40.0000.00912.93
5.5.30.0070.00712.93
5.5.20.0070.00012.93
5.5.10.0040.00812.93
5.5.00.0040.00712.93
5.4.450.0150.03816.14
5.4.440.0520.03516.32
5.4.430.0620.02616.04
5.4.420.0370.00516.22
5.4.410.0470.00516.12
5.4.400.0370.00115.98
5.4.390.0370.00516.09
5.4.380.0350.00416.05
5.4.370.0370.00216.00
5.4.360.0330.00216.00
5.4.350.0360.00316.03
5.4.340.0330.00316.03
5.4.330.0070.00012.93
5.4.320.0080.02012.72
5.4.310.0080.02612.72
5.4.300.0080.02112.72
5.4.290.0050.02312.72
5.4.280.0030.02612.67
5.4.270.0030.02612.67
5.4.260.0050.02212.67
5.4.250.0040.02312.67
5.4.240.0070.01912.67
5.4.230.0080.02212.66
5.4.220.0060.02612.66
5.4.210.0060.02612.66
5.4.200.0090.02412.66
5.4.190.0060.01812.66
5.4.180.0040.02412.66
5.4.170.0050.02012.67
5.4.160.0020.02112.66
5.4.150.0040.02312.66
5.4.140.0080.01912.51
5.4.130.0050.02212.50
5.4.120.0020.02612.48
5.4.110.0040.02112.48
5.4.100.0040.02112.48
5.4.90.0050.02412.48
5.4.80.0080.01912.48
5.4.70.0080.02112.47
5.4.60.0060.02112.48
5.4.50.0050.01812.48
5.4.40.0090.02012.47
5.4.30.0110.01912.47
5.4.20.0020.02112.47
5.4.10.0050.01912.47
5.4.00.0080.01812.21
5.3.290.0080.02212.87
5.3.280.0010.02812.82
5.3.270.0090.01812.82
5.3.260.0030.02512.83
5.3.250.0090.01612.82
5.3.240.0040.02312.83
5.3.230.0050.02112.82
5.3.220.0050.01912.80
5.3.210.0050.02312.80
5.3.200.0050.02012.80
5.3.190.0040.02512.80
5.3.180.0070.02012.80
5.3.170.0040.02012.80
5.3.160.0040.02212.80
5.3.150.0020.02412.80
5.3.140.0050.01812.79
5.3.130.0040.02112.79
5.3.120.0050.02312.79
5.3.110.0020.02312.79
5.3.100.0060.02412.53
5.3.90.0020.02512.52
5.3.80.0060.02012.51
5.3.70.0060.01812.51
5.3.60.0030.02512.51
5.3.50.0030.02312.48
5.3.40.0060.02112.48
5.3.30.0050.02112.46
5.3.20.0040.02012.35
5.3.10.0020.02112.33
5.3.00.0050.02112.32
5.2.170.0040.01811.07
5.2.160.0020.01711.07
5.2.150.0090.01311.07
5.2.140.0070.01711.07
5.2.130.0030.01711.05
5.2.120.0060.01611.05
5.2.110.0050.01611.06
5.2.100.0020.02011.05
5.2.90.0040.01611.05
5.2.80.0070.01611.05
5.2.70.0020.01811.05
5.2.60.0060.01711.03
5.2.50.0030.01711.01
5.2.40.0060.01511.00
5.2.30.0040.01710.99
5.2.20.0060.01510.99
5.2.10.0040.01510.94
5.2.00.0040.01610.87
5.1.60.0070.01210.51
5.1.50.0050.01310.51
5.1.40.0080.01210.50
5.1.30.0040.01410.67
5.1.20.0050.01210.68
5.1.10.0020.01610.54
5.1.00.0010.01610.54
5.0.50.0040.0119.79
5.0.40.0050.0119.71
5.0.30.0020.0199.62
5.0.20.0020.0129.61
5.0.10.0070.0099.59
5.0.00.0030.0159.59
4.4.90.0020.0118.85
4.4.80.0050.0078.84
4.4.70.0050.0108.84
4.4.60.0030.0118.84
4.4.50.0010.0118.85
4.4.40.0020.0158.82
4.4.30.0030.0088.85
4.4.20.0020.0098.88
4.4.10.0000.0128.89
4.4.00.0030.0138.84
4.3.110.0020.0098.80
4.3.100.0010.0128.80
4.3.90.0030.0098.78
4.3.80.0020.0148.76
4.3.70.0050.0078.78
4.3.60.0050.0128.78
4.3.50.0010.0138.78
4.3.40.0010.0218.73
4.3.30.0010.0148.12
4.3.20.0020.0128.11
4.3.10.0050.0118.08
4.3.00.0080.0099.77

preferences:
45.58 ms | 401 KiB | 5 Q