3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call_user_func_fixed() { $args = func_get_args(); $callable = array_shift($args); return 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) || (!$isStaticMethod && !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($func[1]); } catch (ReflectionException $e) { trigger_error('call_user_func() expects parameter 1 to be a valid callback', E_USER_WARNING); return null; } return $method->invokeArgs(null, $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.0090.00617.00
8.3.50.0100.00918.42
8.3.40.0150.00319.17
8.3.30.0030.01419.09
8.3.20.0040.00419.15
8.3.10.0040.00420.69
8.3.00.0050.00317.75
8.2.180.0120.00318.79
8.2.170.0090.00622.96
8.2.160.0060.01022.12
8.2.150.0040.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00520.08
8.2.110.0030.00621.15
8.2.100.0060.00618.16
8.2.90.0000.00819.17
8.2.80.0000.00818.05
8.2.70.0000.00917.88
8.2.60.0050.00318.04
8.2.50.0000.00818.07
8.2.40.0000.00918.34
8.2.30.0040.00418.24
8.2.20.0000.00817.94
8.2.10.0040.00418.03
8.2.00.0040.00417.98
8.1.280.0070.01025.92
8.1.270.0000.00724.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00622.71
8.1.230.0040.00820.89
8.1.220.0080.00017.74
8.1.210.0030.00518.89
8.1.200.0090.00017.60
8.1.190.0040.00417.52
8.1.180.0030.00518.10
8.1.170.0040.00418.89
8.1.160.0050.00318.87
8.1.150.0000.00818.81
8.1.140.0070.00317.54
8.1.130.0000.00717.87
8.1.120.0050.00217.59
8.1.110.0000.00717.62
8.1.100.0000.00717.56
8.1.90.0000.00717.60
8.1.80.0070.00017.63
8.1.70.0000.00817.64
8.1.60.0040.00417.73
8.1.50.0000.00817.62
8.1.40.0040.00417.70
8.1.30.0000.00817.74
8.1.20.0040.00417.82
8.1.10.0020.00517.75
8.1.00.0000.00817.57
8.0.300.0040.00420.01
8.0.290.0040.00417.00
8.0.280.0030.00318.48
8.0.270.0000.00717.30
8.0.260.0030.00316.87
8.0.250.0040.00417.19
8.0.240.0000.00817.13
8.0.230.0030.00517.08
8.0.220.0040.00417.10
8.0.210.0000.00717.07
8.0.200.0030.00317.11
8.0.190.0040.00417.02
8.0.180.0030.00517.14
8.0.170.0000.00817.05
8.0.160.0070.00017.02
8.0.150.0030.00617.09
8.0.140.0080.00216.92
8.0.130.0050.00013.48
8.0.120.0000.00817.01
8.0.110.0040.00417.16
8.0.100.0050.00216.95
8.0.90.0040.00417.13
8.0.80.0070.00717.05
8.0.70.0080.00017.01
8.0.60.0020.00516.93
8.0.50.0000.00716.92
8.0.30.0110.00817.31
8.0.20.0100.00817.11
8.0.10.0000.00717.25
8.0.00.0080.01616.96
7.4.330.0000.00513.27
7.4.320.0030.00316.77
7.4.300.0000.00616.75
7.4.290.0000.00816.73
7.4.280.0070.00016.73
7.4.270.0070.00016.75
7.4.260.0050.00013.49
7.4.250.0030.00616.79
7.4.240.0040.00416.76
7.4.230.0000.00716.92
7.4.220.0130.00616.81
7.4.210.0080.00916.79
7.4.200.0030.00316.82
7.4.190.0000.00716.93
7.4.160.0100.01016.61
7.4.150.0140.00516.77
7.4.140.0110.00816.66
7.4.130.0090.01116.83
7.4.120.0090.01116.78
7.4.110.0100.00716.70
7.4.100.0060.01616.63
7.4.90.0120.00616.70
7.4.80.0070.01016.73
7.4.70.0060.01616.94
7.4.60.0130.00816.79
7.4.50.0060.00316.71
7.4.40.0040.01116.75
7.4.30.0030.01316.61
7.4.00.0090.00615.23
7.3.330.0000.00613.32
7.3.320.0000.00513.36
7.3.310.0030.00316.67
7.3.300.0000.00716.57
7.3.290.0090.00916.59
7.3.280.0100.00616.58
7.3.270.0060.01216.45
7.3.260.0120.00416.66
7.3.250.0160.00716.81
7.3.240.0120.00916.56
7.3.230.0110.00716.55
7.3.210.0100.00716.55
7.3.200.0100.00719.39
7.3.190.0100.01316.46
7.3.180.0000.01616.44
7.3.170.0090.00616.66
7.3.160.0100.00716.83
7.3.120.0130.00315.26
7.2.330.0090.00916.82
7.2.320.0130.00317.00
7.2.310.0060.01217.02
7.2.300.0100.00716.84
7.2.290.0030.01316.75
7.2.00.0260.00419.32
7.1.100.0030.01018.29
7.1.70.0040.00417.25
7.1.60.0040.00817.49
7.1.50.0090.01317.05
7.1.00.0030.04022.42
7.0.200.0060.00917.08
7.0.140.0070.07322.10
7.0.120.0100.06321.96
7.0.110.0130.07719.98
7.0.100.0000.04319.94
7.0.90.0070.08020.07
7.0.80.0100.07320.04
7.0.70.0000.06719.87
7.0.60.0030.07720.04
7.0.50.0000.05720.03
7.0.40.0100.03019.88
7.0.30.0070.03319.82
7.0.20.0100.07319.75
7.0.10.0070.06319.67
7.0.00.0130.06319.61
5.6.280.0070.07021.16
5.6.260.0100.07020.71
5.6.250.0170.06320.76
5.6.240.0070.08320.71
5.6.230.0030.08720.56
5.6.220.0070.08020.86
5.6.210.0100.07720.70
5.6.200.0000.07720.67
5.6.190.0000.07320.63
5.6.180.0030.07720.72
5.6.170.0000.05020.67
5.6.160.0030.06720.70
5.6.150.0030.06720.64
5.6.140.0000.04020.57
5.6.130.0030.03720.65
5.6.120.0030.04320.69
5.6.110.0000.04020.87
5.6.100.0030.03720.61
5.6.90.0100.07320.55
5.6.80.0030.04319.87
5.6.70.0070.04320.05
5.6.60.0070.05320.24
5.6.50.0100.03320.04
5.6.40.0130.05720.03
5.6.30.0100.08020.00
5.6.20.0030.05719.91
5.6.10.0100.06720.07
5.6.00.0070.03720.05
5.5.380.0130.05017.65
5.5.370.0070.07717.50
5.5.360.0000.08717.59
5.5.350.0000.03717.55
5.5.340.0070.07017.93
5.5.330.0100.06317.91
5.5.320.0000.04017.93
5.5.310.0030.03718.22
5.5.300.0030.08717.83
5.5.290.0070.03318.25
5.5.280.0070.05017.93
5.5.270.0030.03717.91
5.5.260.0030.08317.91
5.5.250.0100.07317.91
5.5.240.0000.04317.49
5.5.230.0030.08017.30
5.5.220.0030.04717.47
5.5.210.0070.06717.51
5.5.200.0100.06317.48
5.5.190.0030.04717.46
5.5.180.0000.08717.49
5.5.160.0070.07717.43
5.5.150.0070.03717.31
5.5.140.0030.04317.26
5.5.130.0000.08317.45
5.5.120.0070.03717.27
5.5.110.0000.04017.30
5.5.100.0100.07017.09
5.5.90.0030.06717.35
5.5.80.0130.03017.18
5.5.70.0030.08017.34
5.5.60.0030.07717.20
5.5.50.0030.06317.34
5.5.40.0000.05317.31
5.5.30.0000.04017.45
5.5.20.0130.03017.15
5.5.10.0030.05317.29
5.5.00.0000.04317.07
5.4.450.0030.05019.34
5.4.440.0030.04019.52
5.4.430.0070.03719.57
5.4.420.0030.05319.66
5.4.410.0000.07319.51
5.4.400.0000.05319.01
5.4.390.0070.04319.16
5.4.380.0130.05719.07
5.4.370.0170.05319.19
5.4.360.0070.07719.18
5.4.350.0100.07319.00
5.4.340.0030.07719.14
5.4.320.0030.05019.09
5.4.310.0030.04319.09
5.4.300.0100.06718.99
5.4.290.0070.06019.00
5.4.280.0070.07019.31
5.4.270.0000.04019.22
5.4.260.0100.07019.22
5.4.250.0030.07719.02
5.4.240.0030.07719.24
5.4.230.0070.07019.13
5.4.220.0100.07018.94
5.4.210.0000.06018.95
5.4.200.0030.07719.23
5.4.190.0000.04019.22
5.4.180.0130.07019.17
5.4.170.0070.04019.00
5.4.160.0070.06319.00
5.4.150.0070.07319.07
5.4.140.0000.05016.44
5.4.130.0100.05716.58
5.4.120.0000.07716.39
5.4.110.0070.07716.46
5.4.100.0030.05316.52
5.4.90.0030.07316.36
5.4.80.0130.06716.36
5.4.70.0130.03316.35
5.4.60.0100.07016.56
5.4.50.0100.04716.54
5.4.40.0100.05716.34
5.4.30.0070.06716.45
5.4.20.0100.03016.39
5.4.10.0130.07316.42
5.4.00.0070.07015.83
5.3.290.0070.04014.77
5.3.280.0070.07314.58
5.3.270.0070.06714.65
5.3.260.0000.04014.76
5.3.250.0070.07314.71
5.3.240.0030.06714.66
5.3.230.0030.04714.64
5.3.220.0000.08014.67
5.3.210.0070.07714.55
5.3.200.0030.04014.62
5.3.190.0070.05314.71
5.3.180.0030.07714.59
5.3.170.0030.07014.55
5.3.160.0030.06314.81
5.3.150.0100.07014.62
5.3.140.0030.05014.60
5.3.130.0030.07714.70
5.3.120.0070.07714.61
5.3.110.0100.06714.53
5.3.100.0100.07014.07
5.3.90.0100.07314.17
5.3.80.0030.04014.03
5.3.70.0070.03314.12
5.3.60.0070.07314.16
5.3.50.0100.03714.20
5.3.40.0100.07313.99
5.3.30.0030.07314.02
5.3.20.0030.07713.80
5.3.10.0070.06713.71
5.3.00.0030.04713.89
5.2.170.0030.04711.88
5.2.160.0030.06711.88
5.2.150.0000.07011.88
5.2.140.0030.07311.88
5.2.130.0000.06011.88
5.2.120.0030.06011.88
5.2.110.0000.06311.88
5.2.100.0000.05711.88
5.2.90.0100.05311.88
5.2.80.0100.04711.88
5.2.70.0070.06011.88
5.2.60.0070.05311.91
5.2.50.0030.05011.91
5.2.40.0030.05711.91
5.2.30.0130.04711.91
5.2.20.0000.06711.91
5.2.10.0000.06311.91
5.2.00.0070.06311.91
5.1.60.0100.04711.91
5.1.50.0130.03711.91
5.1.40.0030.05011.91
5.1.30.0030.05711.91
5.1.20.0030.06011.91
5.1.10.0070.05011.91
5.1.00.0070.05011.91
5.0.50.0100.03311.91
5.0.40.0030.04711.91
5.0.30.0030.03311.91
5.0.20.0100.04711.91
5.0.10.0030.03711.91
5.0.00.0000.04711.91
4.4.90.0030.01711.91
4.4.80.0030.03011.91
4.4.70.0030.03711.91
4.4.60.0000.02011.91
4.4.50.0000.02011.91
4.4.40.0030.05311.91
4.4.30.0030.03311.91
4.4.20.0030.03311.91
4.4.10.0070.02711.91
4.4.00.0070.04711.91
4.3.110.0000.02311.91
4.3.100.0030.03311.91
4.3.90.0000.02011.91
4.3.80.0000.05311.91
4.3.70.0000.03011.91
4.3.60.0070.01311.91
4.3.50.0030.02711.91
4.3.40.0030.03311.91
4.3.30.0000.04011.91
4.3.20.0000.03011.91
4.3.10.0000.01711.91
4.3.00.0000.02011.91

preferences:
37.3 ms | 401 KiB | 5 Q