3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call_user_func_fixed() { $args = func_get_args(); $callable = array_shift($args); call_user_func_array_fixed($callable, $args); } function call_user_func_array_fixed($callable, $args) { $isStaticMethod = false; if (is_object($callable) && $callable instanceof \Closure) { $func = $callable; } else if (is_string($callable)) { if (preg_match('/^([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$/', $callable, $matches)) { $func = array($matches[1], $matches[2]); $isStaticMethod = true; } else { $func = $callable; } } else if (is_array($callable) && isset($callable[0], $callable[1]) && count($callable) === 2) { if (is_object($callable[0])) { $func = $callable; } else if (is_string($callable[0])) { $func = $callable; $isStaticMethod = true; } } if (!isset($callable) || !is_callable($callable)) { trigger_error('call_user_func() expects parameter 1 to be a valid callback', E_USER_WARNING); return null; } if (!$isStaticMethod) { return call_user_func_array($func, $args); } try { $class = new ReflectionClass($func[0]); $method = $class->getMethod(ReflectionMethod::IS_STATIC); } catch (ReflectionException $e) { trigger_error('call_user_func() expects parameter 1 to be a valid callback', E_USER_WARNING); return null; } return $method->invokeArgs($args); } class Car { public function run() { return call_user_func_fixed('Toyota::getName'); // should call toyota } private static function getName() { return 'Car'; } } class Toyota extends Car { public static function getName() { return 'Toyota'; } } $car = new Car(); echo $car->run(); //Car instead of Toyota $toyota = new Toyota(); echo $toyota->run(); //Car instead of Toyota

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.0070.00717.13
8.3.50.0170.01222.02
8.3.40.0180.00319.23
8.3.30.0070.00719.01
8.3.20.0090.00620.34
8.3.10.0000.00823.83
8.3.00.0060.00319.51
8.2.180.0110.00718.91
8.2.170.0150.00322.96
8.2.160.0150.00620.47
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.01226.16
8.2.120.0000.00822.25
8.2.110.0070.00422.38
8.2.100.0030.00917.99
8.2.90.0030.00619.35
8.2.80.0000.00817.97
8.2.70.0000.00817.88
8.2.60.0040.00418.04
8.2.50.0090.00018.07
8.2.40.0000.00818.16
8.2.30.0050.00318.13
8.2.20.0060.00318.00
8.2.10.0000.00818.18
8.2.00.0050.00317.88
8.1.280.0110.00725.92
8.1.270.0000.00823.88
8.1.260.0060.00326.35
8.1.250.0050.00228.09
8.1.240.0050.00523.98
8.1.230.0080.00419.21
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0000.00817.55
8.1.180.0000.00818.10
8.1.170.0060.00318.64
8.1.160.0050.00222.07
8.1.150.0040.00418.73
8.1.140.0030.00617.61
8.1.130.0070.00017.75
8.1.120.0020.00517.63
8.1.110.0000.00817.62
8.1.100.0060.00317.66
8.1.90.0000.00717.60
8.1.80.0000.00717.66
8.1.70.0070.00017.47
8.1.60.0050.00517.75
8.1.50.0000.00817.71
8.1.40.0030.00617.58
8.1.30.0040.00417.63
8.1.20.0000.00817.87
8.1.10.0050.00317.71
8.1.00.0030.00517.68
8.0.300.0080.00018.77
8.0.290.0000.00717.30
8.0.280.0070.00018.35
8.0.270.0070.00017.30
8.0.260.0000.00716.93
8.0.250.0030.00317.17
8.0.240.0040.00417.19
8.0.230.0000.00717.19
8.0.220.0030.00317.11
8.0.210.0050.00217.03
8.0.200.0030.00317.12
8.0.190.0000.00817.09
8.0.180.0040.00417.11
8.0.170.0000.00717.16
8.0.160.0040.00417.10
8.0.150.0000.00716.96
8.0.140.0030.00517.10
8.0.130.0030.00313.59
8.0.120.0000.00817.14
8.0.110.0000.00817.12
8.0.100.0030.00616.98
8.0.90.0030.00617.08
8.0.80.0060.01317.11
8.0.70.0030.00517.19
8.0.60.0030.00517.06
8.0.50.0080.00017.00
8.0.30.0090.01117.21
8.0.20.0090.01117.40
8.0.10.0070.00017.25
8.0.00.0110.01116.88
7.4.330.0020.00215.16
7.4.320.0000.00616.61
7.4.300.0080.00016.64
7.4.290.0030.00616.73
7.4.280.0050.00216.84
7.4.270.0000.00716.90
7.4.260.0000.00716.73
7.4.250.0040.00416.72
7.4.240.0040.00416.78
7.4.230.0000.00716.95
7.4.220.0120.00816.86
7.4.210.0090.00716.79
7.4.200.0000.00816.91
7.4.190.0060.00316.55
7.4.160.0060.00916.73
7.4.150.0060.01217.40
7.4.140.0060.01217.86
7.4.130.0120.00516.77
7.4.120.0080.00916.80
7.4.110.0040.01316.88
7.4.100.0090.00916.54
7.4.90.0060.01216.60
7.4.80.0080.01119.39
7.4.70.0120.00616.74
7.4.60.0060.01216.79
7.4.50.0050.00316.79
7.4.40.0090.00622.77
7.4.30.0070.01016.96
7.4.00.0020.01515.08
7.3.330.0030.00313.43
7.3.320.0000.00513.63
7.3.310.0000.00816.65
7.3.300.0030.00316.56
7.3.290.0110.01116.55
7.3.280.0090.00816.57
7.3.270.0140.00317.40
7.3.260.0130.00316.85
7.3.250.0130.01016.83
7.3.240.0060.01216.78
7.3.230.0180.00616.78
7.3.210.0090.00916.61
7.3.200.0110.00719.39
7.3.190.0030.01416.60
7.3.180.0070.01016.75
7.3.170.0040.01216.62
7.3.160.0130.00416.79
7.3.120.0090.00715.19
7.3.110.0080.00815.35
7.3.100.0030.00615.03
7.3.90.0080.00814.97
7.3.80.0070.00315.11
7.3.70.0060.00915.18
7.3.60.0040.00715.11
7.3.50.0030.01014.96
7.3.40.0060.00914.96
7.3.30.0000.01215.09
7.3.20.0100.00316.91
7.3.10.0060.00716.82
7.3.00.0050.00916.85
7.2.330.0060.01317.04
7.2.320.0040.02017.03
7.2.310.0060.01816.77
7.2.300.0070.01016.96
7.2.290.0100.00716.91
7.2.250.0160.00015.49
7.2.240.0030.01715.50
7.2.230.0120.00315.37
7.2.220.0030.00915.13
7.2.210.0060.00915.20
7.2.200.0060.00915.53
7.2.190.0000.01115.50
7.2.180.0100.00715.30
7.2.170.0030.01215.11
7.2.130.0060.00616.89
7.2.120.0060.00917.14
7.2.110.0100.00717.32
7.2.100.0000.01816.91
7.2.90.0070.01117.37
7.2.80.0070.00717.33
7.2.70.0100.00017.20
7.2.60.0070.01017.23
7.2.50.0030.01516.98
7.2.40.0060.00617.20
7.2.30.0060.00617.23
7.2.20.0000.01517.16
7.2.10.0060.00917.10
7.2.00.0100.00317.22
7.1.330.0090.00615.88
7.1.320.0030.01016.09
7.1.310.0120.00315.98
7.1.300.0110.00016.23
7.1.290.0070.00716.08
7.1.280.0040.01216.03
7.1.270.0060.01016.07
7.1.260.0000.01116.10
7.1.250.0030.01016.08
7.1.240.0070.01016.09
7.1.230.0030.00616.12
7.1.220.0000.01116.21
7.1.210.0040.01116.09
7.1.200.0030.00716.06
7.1.190.0130.00315.75
7.1.180.0000.00815.85
7.1.170.0090.00316.07
7.1.160.0130.00316.19
7.1.150.0060.00615.76
7.1.140.0060.00615.74
7.1.130.0090.00616.02
7.1.120.0060.00916.10
7.1.110.0000.01516.10
7.1.100.0070.00715.86
7.1.90.0040.00716.04
7.1.80.0150.00316.16
7.1.70.0050.00816.51
7.1.60.0070.01417.75
7.1.50.0040.01216.39
7.1.40.0060.00615.95
7.1.30.0000.00915.81
7.1.20.0100.01015.98
7.1.10.0040.01115.89
7.1.00.0050.04119.15
7.0.330.0050.00515.47
7.0.320.0000.01215.41
7.0.310.0030.01015.54
7.0.300.0030.00915.68
7.0.290.0120.00315.33
7.0.280.0040.00415.69
7.0.270.0040.00415.51
7.0.260.0000.01115.71
7.0.250.0070.00615.60
7.0.240.0000.00915.87
7.0.230.0030.00715.70
7.0.220.0070.01015.64
7.0.210.0070.00715.48
7.0.200.0000.01016.05
7.0.190.0040.00715.63
7.0.180.0030.01015.63
7.0.170.0110.00315.59
7.0.160.0060.00615.62
7.0.150.0030.01015.73
7.0.140.0080.03718.90
7.0.130.0070.00715.70
7.0.120.0070.00715.41
7.0.110.0040.00715.77
7.0.100.0080.00315.38
7.0.90.0000.01215.67
7.0.80.0000.01215.66
7.0.70.0080.04418.73
7.0.60.0030.04318.63
7.0.50.0050.02818.79
7.0.40.0080.04116.73
7.0.30.0070.04416.77
7.0.20.0040.04916.91
7.0.10.0100.03816.82
7.0.00.0070.02816.91
5.6.380.0040.01114.29
5.6.370.0030.00614.69
5.6.360.0000.01114.26
5.6.350.0120.00014.78
5.6.340.0040.01114.37
5.6.330.0040.00714.80
5.6.320.0040.00814.66
5.6.310.0070.00614.39
5.6.300.0000.01214.68
5.6.290.0060.00914.55
5.6.280.0020.04117.68
5.6.270.0030.00714.90
5.6.260.0030.00714.63
5.6.250.0030.00914.50
5.6.240.0040.00414.64
5.6.230.0090.00614.32
5.6.220.0070.04517.48
5.6.210.0060.04317.48
5.6.200.0020.04517.70
5.6.190.0050.02517.63
5.6.180.0000.04717.85
5.6.170.0080.04217.78
5.6.160.0080.04517.80
5.6.150.0070.03217.75
5.6.140.0090.03817.75
5.6.130.0030.04717.69
5.6.120.0020.03417.65
5.6.110.0070.04217.76
5.6.100.0080.04017.66
5.6.90.0080.04217.76
5.6.80.0050.02617.34
5.6.70.0110.03917.36
5.6.60.0100.04317.54
5.6.50.0040.04317.45
5.6.40.0050.04017.36
5.6.30.0020.04417.40
5.6.20.0020.04017.46
5.6.10.0090.04017.28
5.6.00.0070.02817.42
5.5.380.0030.00611.25
5.5.370.0000.01211.25
5.5.360.0000.03215.75
5.5.350.0050.02915.83
5.5.340.0080.04516.02
5.5.330.0020.04816.11
5.5.320.0070.04516.05
5.5.310.0030.03616.18
5.5.300.0030.03215.91
5.5.290.0040.04615.89
5.5.280.0100.01816.12
5.5.270.0120.03416.15
5.5.260.0020.04815.91
5.5.250.0120.02516.11
5.5.240.0060.04115.62
5.5.230.0100.04015.53
5.5.220.0070.04415.78
5.5.210.0060.04315.66
5.5.200.0120.03615.76
5.5.190.0020.03415.73
5.5.180.0080.03215.79
5.5.170.0040.00711.15
5.5.160.0050.04315.81
5.5.150.0070.04015.64
5.5.140.0060.02715.63
5.5.130.0030.04815.78
5.5.120.0030.02215.74
5.5.110.0070.04015.74
5.5.100.0070.04315.78
5.5.90.0050.04315.51
5.5.80.0000.04715.75
5.5.70.0050.04215.71
5.5.60.0020.03215.61
5.5.50.0050.02315.54
5.5.40.0070.04515.65
5.5.30.0080.04115.64
5.5.20.0100.02515.61
5.5.10.0050.04415.62
5.5.00.0060.04515.68
5.4.450.0050.04315.24
5.4.440.0030.02815.24
5.4.430.0040.03915.42
5.4.420.0050.03315.34
5.4.410.0050.03815.32
5.4.400.0050.02915.23
5.4.390.0080.04015.04
5.4.380.0020.04015.04
5.4.370.0110.03015.07
5.4.360.0050.04215.05
5.4.350.0090.03715.28
5.4.340.0060.02914.97
5.4.330.0030.00611.25
5.4.320.0010.04415.14
5.4.310.0060.03315.09
5.4.300.0030.04215.12
5.4.290.0070.03315.11
5.4.280.0020.03015.22
5.4.270.0060.03914.90
5.4.260.0050.04114.92
5.4.250.0070.03715.15
5.4.240.0000.04615.02
5.4.230.0050.03115.05
5.4.220.0050.04615.04
5.4.210.0050.02515.10
5.4.200.0020.04715.07
5.4.190.0060.03114.88
5.4.180.0050.02515.09
5.4.170.0050.04315.08
5.4.160.0080.02515.04
5.4.150.0100.03815.03
5.4.140.0030.03613.72
5.4.130.0050.03813.77
5.4.120.0070.03713.75
5.4.110.0080.03513.97
5.4.100.0070.03513.78
5.4.90.0070.03713.87
5.4.80.0020.04713.68
5.4.70.0040.03013.76
5.4.60.0030.03813.74
5.4.50.0040.02713.85
5.4.40.0030.02613.70
5.4.30.0000.03513.71
5.4.20.0080.04013.62
5.4.10.0020.04613.73
5.4.00.0070.04013.37
5.3.290.0060.04012.76
5.3.280.0070.04112.73
5.3.270.0030.04512.73
5.3.260.0020.04512.78
5.3.250.0050.03812.80
5.3.240.0080.04012.79
5.3.230.0060.03612.83
5.3.220.0060.04112.75
5.3.210.0050.04012.80
5.3.200.0020.04012.80
5.3.190.0100.03712.80
5.3.180.0100.03912.78
5.3.170.0050.04212.71
5.3.160.0100.03712.81
5.3.150.0030.04512.73
5.3.140.0130.03012.72
5.3.130.0060.03512.75
5.3.120.0100.04012.72
5.3.110.0030.04312.75
5.3.100.0080.03912.51
5.3.90.0090.03912.48
5.3.80.0030.04012.42
5.3.70.0080.04012.46
5.3.60.0060.02612.52
5.3.50.0080.03612.43
5.3.40.0090.03012.50
5.3.30.0050.04012.38
5.3.20.0080.03312.31
5.3.10.0020.03312.25
5.3.00.0080.03512.22
5.2.170.0070.03311.10
5.2.160.0030.02211.09
5.2.150.0020.03211.08
5.2.140.0030.03411.06
5.2.130.0020.03510.94
5.2.120.0110.02311.04
5.2.110.0020.03211.02
5.2.100.0070.02511.08
5.2.90.0030.01811.07
5.2.80.0030.03710.96
5.2.70.0000.02511.08
5.2.60.0020.02710.93
5.2.50.0000.02210.98
5.2.40.0010.02611.01
5.2.30.0000.02410.91
5.2.20.0030.03210.87
5.2.10.0050.03010.94
5.2.00.0000.03510.83
5.1.60.0050.03010.60
5.1.50.0050.02510.60
5.1.40.0050.02810.60
5.1.30.0030.02710.63
5.1.20.0050.03010.71
5.1.10.0030.03010.60
5.1.00.0030.03110.60
5.0.50.0000.01610.60
5.0.40.0040.02210.60
5.0.30.0040.03310.60
5.0.20.0020.02110.60
5.0.10.0000.02510.60
5.0.00.0030.02810.60
4.4.90.0000.01910.57
4.4.80.0000.02110.57
4.4.70.0050.01710.59
4.4.60.0000.02010.60
4.4.50.0020.01710.60
4.4.40.0030.02810.60
4.4.30.0020.01710.60
4.4.20.0030.01610.60
4.4.10.0020.01310.60
4.4.00.0030.02810.60
4.3.110.0020.01910.60
4.3.100.0020.01810.60
4.3.90.0000.02010.60
4.3.80.0020.02610.60
4.3.70.0020.01910.60
4.3.60.0010.02010.60
4.3.50.0000.02210.60
4.3.40.0010.02810.60
4.3.30.0020.02210.60
4.3.20.0000.02210.60
4.3.10.0050.01810.60
4.3.00.0000.02010.60

preferences:
44.63 ms | 401 KiB | 5 Q