3v4l.org

run code in 300+ PHP versions simultaneously
<?php function userland_call_user_func($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 Test1 { private function foo() { echo new Exception; } public function callFoo($callfunc) { $new=new Test2; $callfunc(array($new, 'foo')); } } class Test2 { private function foo() { echo new Exception; } } $o = new Test1; $o->callFoo('userland_call_user_func'); $o->callFoo('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.0120.00318.36
8.3.50.0150.00822.12
8.3.40.0090.00918.69
8.3.30.0090.00619.00
8.3.20.0040.00420.13
8.3.10.0040.00420.66
8.3.00.0030.00519.38
8.2.180.0100.01018.41
8.2.170.0100.01022.96
8.2.160.0070.01022.13
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00321.04
8.2.110.0080.00321.03
8.2.100.0060.00617.84
8.2.90.0040.00420.64
8.2.80.0040.00420.37
8.2.70.0000.00817.63
8.2.60.0060.00317.63
8.2.50.0030.00518.10
8.2.40.0000.00820.77
8.2.30.0040.00417.68
8.2.20.0050.00317.87
8.2.10.0050.00317.93
8.2.00.0000.00817.67
8.1.280.0100.01025.92
8.1.270.0040.00423.97
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.02
8.1.230.0110.00020.98
8.1.220.0090.00017.74
8.1.210.0000.00818.88
8.1.200.0040.00417.35
8.1.190.0000.01017.23
8.1.180.0040.00418.10
8.1.170.0090.00018.51
8.1.160.0000.00718.83
8.1.150.0040.00418.91
8.1.140.0040.00417.48
8.1.130.0030.00317.85
8.1.120.0030.00317.47
8.1.110.0040.00417.38
8.1.100.0040.00417.49
8.1.90.0000.00717.39
8.1.80.0040.00417.45
8.1.70.0080.00017.43
8.1.60.0000.00817.63
8.1.50.0030.00517.53
8.1.40.0030.00517.55
8.1.30.0030.00617.57
8.1.20.0040.00417.70
8.1.10.0060.00317.62
8.1.00.0000.00817.56
8.0.300.0040.00420.07
8.0.290.0040.00416.75
8.0.280.0030.00518.47
8.0.270.0000.00718.00
8.0.260.0000.00717.28
8.0.250.0030.00316.92
8.0.240.0070.00016.98
8.0.230.0030.00717.00
8.0.220.0030.00316.85
8.0.210.0030.00316.93
8.0.200.0000.00817.02
8.0.190.0000.00916.91
8.0.180.0040.00416.96
8.0.170.0040.00416.92
8.0.160.0040.00316.96
8.0.150.0000.00716.93
8.0.140.0030.00717.00
8.0.130.0000.00613.44
8.0.120.0060.00316.98
8.0.110.0040.00416.88
8.0.100.0000.00716.96
8.0.90.0000.00817.02
8.0.80.0100.00616.97
8.0.70.0050.00317.01
8.0.60.0050.00217.03
8.0.50.0040.00417.02
8.0.30.0120.00817.09
8.0.20.0100.01117.40
8.0.10.0020.00517.07
8.0.00.0120.00616.85
7.4.330.0060.00015.00
7.4.320.0000.00616.46
7.4.300.0000.00616.52
7.4.290.0070.00016.61
7.4.280.0040.00416.60
7.4.270.0000.00716.42
7.4.260.0030.00316.52
7.4.250.0000.00816.57
7.4.240.0030.00516.55
7.4.230.0070.00016.70
7.4.220.0070.01216.62
7.4.210.0090.00616.62
7.4.200.0040.00416.46
7.4.160.0110.00416.48
7.4.150.0080.01117.40
7.4.140.0060.01117.86
7.4.130.0100.00716.54
7.4.120.0050.01416.53
7.4.110.0100.01016.59
7.4.100.0070.01016.74
7.4.90.0070.01016.55
7.4.80.0150.00319.39
7.4.70.0040.01316.76
7.4.60.0130.00416.46
7.4.50.0000.00816.59
7.4.40.0100.00716.28
7.4.30.0030.01316.37
7.4.00.0040.01415.16
7.3.330.0050.00013.29
7.3.320.0020.00213.45
7.3.310.0050.00216.43
7.3.300.0000.00616.30
7.3.290.0070.01016.43
7.3.280.0120.00516.37
7.3.270.0130.00717.40
7.3.260.0120.00616.38
7.3.250.0100.00716.41
7.3.240.0120.01216.36
7.3.230.0140.00316.45
7.3.210.0100.00716.34
7.3.200.0150.00919.39
7.3.190.0070.01016.73
7.3.180.0130.00316.56
7.3.170.0070.01016.44
7.3.160.0060.01216.68
7.2.330.0100.00716.50
7.2.320.0130.00316.47
7.2.310.0090.00916.87
7.2.300.0060.01216.80
7.2.290.0150.00316.91
7.2.110.0040.00416.49
7.2.100.0030.00716.63
7.2.90.0030.01016.64
7.2.80.0070.00716.48
7.2.70.0090.00317.14
7.2.60.0120.00516.90
7.2.50.0060.00617.04
7.2.40.0070.00716.94
7.2.30.0040.00816.67
7.2.20.0080.00816.89
7.2.10.0040.01117.00
7.2.00.0020.01518.19
7.1.230.0030.00615.97
7.1.220.0030.01015.79
7.1.210.0060.00915.88
7.1.200.0030.00715.84
7.1.190.0070.00415.61
7.1.180.0080.00315.85
7.1.170.0070.00015.79
7.1.160.0090.00315.83
7.1.150.0040.00415.99
7.1.140.0040.00715.92
7.1.130.0110.00415.75
7.1.120.0070.01015.76
7.1.110.0120.00315.95
7.1.100.0060.00616.94
7.1.90.0070.00415.80
7.1.80.0040.00715.76
7.1.70.0070.00616.30
7.1.60.0050.00817.71
7.1.50.0150.01225.27
7.1.40.0030.01315.77
7.1.30.0040.00815.91
7.1.20.0060.01016.07
7.1.10.0000.01015.84
7.1.00.0060.04019.10
7.0.310.0000.00715.57
7.0.300.0080.00415.49
7.0.290.0060.00615.21
7.0.280.0040.01115.18
7.0.270.0070.00415.43
7.0.260.0080.00315.19
7.0.250.0100.00315.35
7.0.240.0040.01115.25
7.0.230.0030.00715.44
7.0.220.0030.00715.28
7.0.210.0030.00715.46
7.0.200.0020.00615.98
7.0.190.0040.00415.37
7.0.180.0040.00715.54
7.0.170.0070.00315.25
7.0.160.0090.00315.35
7.0.150.0070.00315.39
7.0.140.0070.03518.62
7.0.130.0030.00715.27
7.0.120.0030.00615.56
7.0.110.0040.00715.30
7.0.100.0040.00715.44
7.0.90.0070.00715.45
7.0.80.0110.00015.26
7.0.70.0030.00915.27
7.0.60.0080.03817.65
7.0.50.0030.02316.68
7.0.40.0050.03016.74
7.0.30.0210.02016.80
7.0.20.0130.04716.94
7.0.10.0210.02916.84
7.0.00.0050.04516.83
5.6.380.0080.00014.29
5.6.370.0040.00714.51
5.6.360.0040.00414.48
5.6.350.0050.00214.28
5.6.340.0040.01114.31
5.6.330.0030.00914.47
5.6.320.0000.00914.22
5.6.310.0030.00714.40
5.6.300.0000.01014.43
5.6.290.0030.00714.52
5.6.280.0080.03717.74
5.6.270.0000.01514.39
5.6.260.0120.00314.35
5.6.250.0000.01214.12
5.6.240.0040.00814.33
5.6.230.0100.00014.18
5.6.220.0030.00714.16
5.6.210.0100.03517.44
5.6.200.0020.03616.30
5.6.190.0050.04717.47
5.6.180.0200.03917.67
5.6.170.0230.03517.37
5.6.160.0020.02317.20
5.6.150.0050.04216.37
5.6.140.0060.04316.20
5.6.130.0030.03216.27
5.6.120.0080.04117.75
5.6.110.0030.05017.70
5.6.100.0080.04017.71
5.6.90.0070.04617.60
5.6.80.0120.03017.32
5.6.70.1280.02917.38
5.6.60.0030.00914.30
5.6.50.0030.00714.22
5.6.40.0080.00014.13
5.6.30.0000.00714.14
5.6.20.0090.00314.00
5.6.10.0100.00314.52
5.6.00.0090.00314.10
5.5.380.0000.00510.73
5.5.370.0060.00610.95
5.5.360.0000.00510.80
5.5.350.0120.03815.54
5.5.340.0060.02314.28
5.5.330.0170.03515.69
5.5.320.0210.04215.62
5.5.310.0130.04715.64
5.5.300.0050.04214.45
5.5.290.0040.04414.47
5.5.280.0020.02615.99
5.5.270.0050.02315.90
5.5.260.0050.04215.92
5.5.250.0030.03315.68
5.5.240.0170.03515.61
5.5.230.0030.00310.68
5.5.220.0060.00610.94
5.5.210.0040.00410.89
5.5.200.0060.00310.85
5.5.190.0060.00610.89
5.5.180.0000.00811.02
5.5.170.0100.00314.14
5.5.160.0030.00610.91
5.5.150.0030.00310.91
5.5.140.0030.00310.80
5.5.130.0030.00611.04
5.5.120.0000.00610.76
5.5.110.0060.00611.00
5.5.100.0030.00611.08
5.5.90.0000.00710.99
5.5.80.0000.01011.02
5.5.70.0070.00310.87
5.5.60.0030.00610.88
5.5.50.0030.00610.86
5.5.40.0030.00710.50
5.5.30.0060.00310.78
5.5.20.0090.00310.96
5.5.10.0000.01010.75
5.5.00.0050.00011.00
5.4.450.0650.02415.34
5.4.440.0400.03715.30
5.4.430.0400.03215.16
5.4.420.0330.00315.22
5.4.410.0340.00215.23
5.4.400.0320.00415.01
5.4.390.0360.00014.91
5.4.380.0360.00114.97
5.4.370.0360.00014.88
5.4.360.0300.00314.93
5.4.350.0350.00114.90
5.4.340.0340.00014.80
5.4.330.0000.00510.44
5.4.320.0070.01911.68
5.4.310.0050.02211.78
5.4.300.0040.02211.57
5.4.290.0060.01911.69
5.4.280.0020.02111.57
5.4.270.0040.02111.41
5.4.260.0060.01911.72
5.4.250.0040.02111.53
5.4.240.0020.02211.61
5.4.230.0020.02411.54
5.4.220.0050.01911.60
5.4.210.0050.01911.67
5.4.200.0030.02411.63
5.4.190.0020.02111.56
5.4.180.0070.01911.57
5.4.170.0070.01911.54
5.4.160.0020.02311.51
5.4.150.0050.01911.44
5.4.140.0060.02011.46
5.4.130.0040.02111.42
5.4.120.0060.01911.29
5.4.110.0050.01911.54
5.4.100.0040.02111.29
5.4.90.0040.02311.46
5.4.80.0060.02411.43
5.4.70.0020.02311.46
5.4.60.0030.02211.44
5.4.50.0060.01911.33
5.4.40.0050.01911.45
5.4.30.0050.02011.40
5.4.20.0030.02011.33
5.4.10.0080.02211.50
5.4.00.0020.02311.16
5.3.290.0060.02211.60
5.3.280.0050.01911.54
5.3.270.0020.02211.53
5.3.260.0020.02211.49
5.3.250.0080.01911.57
5.3.240.0030.02311.46
5.3.230.0060.02011.54
5.3.220.0050.02111.34
5.3.210.0050.02111.44
5.3.200.0070.01911.47
5.3.190.0020.02111.49
5.3.180.0040.02011.41
5.3.170.0040.02111.56
5.3.160.0050.02011.55
5.3.150.0050.01911.43
5.3.140.0070.01911.53
5.3.130.0040.02211.50
5.3.120.0050.02011.40
5.3.110.0040.02111.49
5.3.100.0050.02011.23
5.3.90.0040.02111.15
5.3.80.0060.01911.25
5.3.70.0050.02211.08
5.3.60.0030.02211.20
5.3.50.0040.02211.17
5.3.40.0050.02011.03
5.3.30.0060.01911.09
5.3.20.0020.02110.95
5.3.10.0030.02010.92
5.3.00.0020.02110.88
5.2.170.0040.0179.29
5.2.160.0010.0199.24
5.2.150.0050.0179.30
5.2.140.0060.0159.28
5.2.130.0020.0179.22
5.2.120.0020.0189.26
5.2.110.0030.0169.22
5.2.100.0030.0169.22
5.2.90.0020.0199.22
5.2.80.0040.0179.23
5.2.70.0050.0169.22
5.2.60.0020.0179.20
5.2.50.0050.0149.20
5.2.40.0050.0149.17
5.2.30.0030.0189.16
5.2.20.0040.0169.15
5.2.10.0040.0149.11
5.2.00.0040.0169.04
5.1.60.0020.0138.68
5.1.50.0030.0138.68
5.1.40.0050.0128.67
5.1.30.0030.0158.85
5.1.20.0050.0148.86
5.1.10.0020.0178.71
5.1.00.0040.0148.71
5.0.50.0020.0137.95
5.0.40.0040.0097.88
5.0.30.0040.0167.79
5.0.20.0010.0137.78
5.0.10.0050.0097.76
5.0.00.0010.0207.76
4.4.90.0030.0077.03
4.4.80.0040.0117.01
4.4.70.0030.0107.01
4.4.60.0030.0097.01
4.4.50.0040.0077.02
4.4.40.0010.0166.99
4.4.30.0020.0097.02
4.4.20.0020.0117.06
4.4.10.0020.0117.06
4.4.00.0020.0147.02
4.3.110.0040.0086.97
4.3.100.0040.0066.97
4.3.90.0020.0086.95
4.3.80.0030.0136.93
4.3.70.0010.0116.95
4.3.60.0010.0116.95
4.3.50.0020.0096.95
4.3.40.0020.0146.90
4.3.30.0010.0116.29
4.3.20.0030.0096.28
4.3.10.0010.0106.25
4.3.00.0030.0108.37

preferences:
40.15 ms | 401 KiB | 5 Q