3v4l.org

run code in 300+ PHP versions simultaneously
<?php function userland_call_user_func($function, ...$args) { $class = isset(debug_backtrace()[1]['class']) ? debug_backtrace()[1]['class'] : null; return Closure::bind(function () use ($args, $function) { return $function(...$args); }, null, $class)->__invoke(); } 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.0040.01118.30
8.3.50.0090.00916.34
8.3.40.0120.00418.79
8.3.30.0070.00719.05
8.3.20.0080.00020.30
8.3.10.0040.00420.66
8.3.00.0060.00319.25
8.2.180.0150.00018.42
8.2.170.0090.00622.96
8.2.160.0110.00320.57
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00022.25
8.2.110.0090.00020.96
8.2.100.0090.00317.97
8.2.90.0050.00317.88
8.2.80.0050.00318.96
8.2.70.0040.00417.75
8.2.60.0030.00619.48
8.2.50.0000.00917.75
8.2.40.0040.00419.48
8.2.30.0030.00618.08
8.2.20.0040.00417.69
8.2.10.0030.00518.11
8.2.00.0050.00217.69
8.1.280.0030.01425.92
8.1.270.0090.00021.96
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0030.00721.42
8.1.230.0060.00619.15
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0080.00017.47
8.1.190.0060.00317.48
8.1.180.0030.00518.88
8.1.170.0060.00317.62
8.1.160.0030.00522.04
8.1.150.0040.00418.90
8.1.140.0030.00517.48
8.1.130.0030.00317.71
8.1.120.0040.00417.52
8.1.110.0040.00417.52
8.1.100.0050.00217.41
8.1.90.0000.00717.38
8.1.80.0030.00517.36
8.1.70.0030.00317.40
8.1.60.0040.00417.50
8.1.50.0000.00817.44
8.1.40.0070.00017.41
8.1.30.0080.00017.61
8.1.20.0040.00417.60
8.1.10.0040.00417.58
8.1.00.0000.00717.51
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0000.00718.45
8.0.270.0000.00717.32
8.0.260.0000.00617.21
8.0.250.0040.00416.99
8.0.240.0040.00417.08
8.0.230.0050.00217.01
8.0.220.0030.00316.93
8.0.210.0030.00316.99
8.0.200.0030.00317.07
8.0.190.0000.00817.01
8.0.180.0000.00717.03
8.0.170.0030.00616.97
8.0.160.0030.00317.09
8.0.150.0030.00316.86
8.0.140.0030.00616.90
8.0.130.0040.00413.31
8.0.120.0040.00416.95
8.0.110.0040.00417.07
8.0.100.0040.00417.00
8.0.90.0040.00417.09
8.0.80.0090.01217.03
8.0.70.0000.00716.79
8.0.60.0000.00817.07
8.0.50.0040.00416.95
8.0.30.0090.01017.14
8.0.20.0120.00817.40
8.0.10.0000.00817.09
8.0.00.0060.01316.75
7.4.330.0000.00515.00
7.4.320.0030.00316.60
7.4.300.0000.00716.52
7.4.290.0050.00316.61
7.4.280.0000.00716.44
7.4.270.0030.00316.63
7.4.260.0040.00416.50
7.4.250.0060.00316.45
7.4.240.0020.00516.52
7.4.230.0030.00316.50
7.4.220.0080.01216.69
7.4.210.0040.01016.39
7.4.200.0070.00016.62
7.4.160.0060.01616.41
7.4.150.0130.00917.40
7.4.140.0080.00917.86
7.4.130.0100.00916.51
7.4.120.0100.00716.68
7.4.110.0090.00916.65
7.4.100.0060.01016.55
7.4.90.0120.00616.54
7.4.80.0090.00919.39
7.4.70.0110.00816.46
7.4.60.0000.02216.39
7.4.50.0020.00216.58
7.4.40.0030.01316.57
7.4.30.0060.01516.63
7.4.00.0070.00615.14
7.3.330.0020.00213.47
7.3.320.0030.00313.38
7.3.310.0070.00016.47
7.3.300.0070.00016.41
7.3.290.0140.00716.42
7.3.280.0080.00916.43
7.3.270.0090.00917.40
7.3.260.0030.01316.51
7.3.250.0130.00516.45
7.3.240.0070.01616.66
7.3.230.0120.00416.39
7.3.210.0100.00716.39
7.3.200.0060.01619.39
7.3.190.0100.00716.52
7.3.180.0060.00916.41
7.3.170.0110.00716.50
7.3.160.0140.00416.62
7.3.120.0050.01014.88
7.3.110.0120.00314.78
7.3.100.0070.00514.81
7.3.90.0080.00514.70
7.3.80.0070.00514.98
7.3.70.0080.00714.79
7.3.60.0100.00514.90
7.3.50.0050.00914.81
7.3.40.0050.01014.88
7.3.30.0060.00914.97
7.3.20.0080.00716.47
7.3.10.0050.01116.67
7.3.00.0060.00716.79
7.2.330.0130.00316.52
7.2.320.0120.00616.54
7.2.310.0100.00716.80
7.2.300.0120.00916.62
7.2.290.0070.01016.54
7.2.250.0030.01714.80
7.2.240.0060.00915.12
7.2.230.0070.00814.87
7.2.220.0050.00814.89
7.2.210.0030.01014.89
7.2.200.0060.00815.03
7.2.190.0060.00815.15
7.2.180.0050.00615.12
7.2.170.0050.01014.66
7.2.160.0030.01015.25
7.2.150.0100.00316.75
7.2.140.0090.00416.67
7.2.130.0180.00316.92
7.2.120.0130.00316.90
7.2.110.0070.00717.08
7.2.100.0060.00616.93
7.2.90.0030.00616.64
7.2.80.0070.00716.88
7.2.70.0070.00717.04
7.2.60.0060.00716.77
7.2.50.0070.00716.78
7.2.40.0080.00816.66
7.2.30.0070.00317.05
7.2.20.0040.01116.87
7.2.10.0050.00516.86
7.2.00.0050.01118.18
7.1.330.0060.00615.83
7.1.320.0090.00415.88
7.1.310.0050.00615.70
7.1.300.0030.01015.69
7.1.290.0050.00915.76
7.1.280.0060.00315.80
7.1.270.0070.00715.56
7.1.260.0060.00615.82
7.1.250.0060.01115.95
7.1.200.0100.00315.63
7.1.100.0030.01018.25
7.1.70.0040.00417.08
7.1.60.0070.01719.32
7.1.50.0200.02034.81
7.1.00.0070.07322.54
7.0.200.0000.01016.89
7.0.140.0030.07021.95
7.0.60.0070.08019.81
7.0.50.0130.07317.89
7.0.40.0030.05720.40
7.0.30.0230.08720.11
7.0.20.0270.08020.09
7.0.10.0030.04720.24
7.0.00.0130.08720.20
5.6.280.0130.06320.89
5.6.210.0130.07320.58
5.6.200.0070.08018.19
5.6.190.0100.09320.50
5.6.180.0500.07720.48
5.6.170.0330.07720.56
5.6.160.0070.07320.48
5.6.150.0130.07318.18
5.6.140.0170.02718.21
5.6.130.0170.05318.14
5.6.120.0100.08720.93
5.6.110.0070.08721.01
5.6.100.0170.07720.90
5.6.90.0170.06721.02
5.6.80.0070.07720.42
5.5.350.0100.06720.34
5.5.340.0100.06717.97
5.5.330.0070.08020.27
5.5.320.0430.07020.31
5.5.310.0170.04320.30
5.5.300.0030.05318.08
5.5.290.0030.08018.04
5.5.280.0170.06320.66
5.5.270.0000.04720.82
5.5.260.0170.07020.87
5.5.250.0100.08320.64
5.5.240.0300.07720.12
5.4.450.0700.05019.55
5.4.440.0870.05319.54
5.4.430.0830.05719.59
5.4.420.0700.00019.41
5.4.410.0630.00019.57
5.4.400.0630.00019.14
5.4.390.0630.00019.13
5.4.380.0670.00019.13
5.4.370.0600.00019.13
5.4.360.0600.00019.05
5.4.350.0630.00019.11
5.4.340.0630.00019.03
5.4.320.0020.03912.52
5.4.310.0050.03812.51
5.4.300.0040.03812.52
5.4.290.0060.03812.51
5.4.280.0040.03612.41
5.4.270.0020.03912.40
5.4.260.0030.04712.41
5.4.250.0140.02912.40
5.4.240.0050.04012.40
5.4.230.0030.03912.40
5.4.220.0070.03512.40
5.4.210.0060.03512.40
5.4.200.0030.03912.39
5.4.190.0050.03612.39
5.4.180.0040.03712.39
5.4.170.0060.03512.40
5.4.160.0080.03312.40
5.4.150.0050.03612.39
5.4.140.0030.03912.08
5.4.130.0070.04412.06
5.4.120.0040.03612.03
5.4.110.0070.04212.03
5.4.100.0080.03312.03
5.4.90.0080.03612.03
5.4.80.0090.03512.03
5.4.70.0070.03612.02
5.4.60.0050.03512.02
5.4.50.0070.03412.02
5.4.40.0040.03612.01
5.4.30.0050.03612.01
5.4.20.0030.03912.00
5.4.10.0060.03412.01
5.4.00.0100.03111.50
5.3.290.0070.04012.80
5.3.280.0020.04112.71
5.3.270.0040.04112.72
5.3.260.0070.03912.72
5.3.250.0060.03712.72
5.3.240.0040.03912.72
5.3.230.0070.03712.71
5.3.220.0060.04212.68
5.3.210.0100.03812.68
5.3.200.0050.04012.68
5.3.190.0040.03912.68
5.3.180.0040.03712.68
5.3.170.0040.03912.67
5.3.160.0010.04212.68
5.3.150.0060.03612.67
5.3.140.0100.03212.66
5.3.130.0050.03912.66
5.3.120.0070.03612.66
5.3.110.0060.03912.66
5.3.100.0050.03612.13
5.3.90.0060.03512.11
5.3.80.0060.03512.09
5.3.70.0070.03512.09
5.3.60.0060.04112.08
5.3.50.0070.03312.02
5.3.40.0050.03712.02
5.3.30.0050.03411.98
5.3.20.0080.03811.76
5.3.10.0070.03311.74
5.3.00.0020.03811.72
5.2.170.0040.0359.21
5.2.160.0050.0299.22
5.2.150.0050.0299.22
5.2.140.0030.0319.21
5.2.130.0040.0359.17
5.2.120.0050.0279.18
5.2.110.0040.0399.18
5.2.100.0050.0319.18
5.2.90.0060.0369.19
5.2.80.0050.0309.17
5.2.70.0050.0299.18
5.2.60.0050.0299.13
5.2.50.0040.0299.09
5.2.40.0020.0309.07
5.2.30.0050.0329.05
5.2.20.0030.0369.04
5.2.10.0050.0268.95
5.2.00.0000.0378.81
5.1.60.0070.0228.08
5.1.50.0080.0238.09
5.1.40.0040.0248.06
5.1.30.0020.0278.42
5.1.20.0060.0248.44
5.1.10.0060.0308.16
5.1.00.0020.0278.16
5.0.50.0040.0196.64
5.0.40.0020.0206.50
5.0.30.0040.0306.31
5.0.20.0010.0276.29
5.0.10.0040.0206.26
5.0.00.0020.0356.25
4.4.90.0030.0144.78
4.4.80.0010.0164.76
4.4.70.0040.0134.75
4.4.60.0030.0144.76
4.4.50.0020.0154.77
4.4.40.0030.0344.71
4.4.30.0030.0194.76
4.4.20.0040.0154.84
4.4.10.0010.0204.85
4.4.00.0030.0244.76
4.3.110.0020.0164.67
4.3.100.0050.0184.67
4.3.90.0040.0194.63
4.3.80.0010.0244.59
4.3.70.0010.0154.63
4.3.60.0040.0194.63
4.3.50.0020.0224.63
4.3.40.0020.0234.54
4.3.30.0010.0183.30
4.3.20.0000.0173.29
4.3.10.0040.0193.24
4.3.00.0200.0407.45

preferences:
39.22 ms | 400 KiB | 5 Q