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) || !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.70.0150.00016.75
8.3.60.0090.00616.88
8.3.50.0110.00817.49
8.3.40.0060.00919.08
8.3.30.0080.00818.88
8.3.20.0040.00418.89
8.3.10.0030.00620.95
8.3.00.0000.00817.75
8.2.180.0190.00016.50
8.2.170.0150.00322.96
8.2.160.0120.00322.44
8.2.150.0040.00424.18
8.2.140.0050.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00320.08
8.2.110.0070.00321.19
8.2.100.0080.00417.84
8.2.90.0030.00621.06
8.2.80.0050.00318.16
8.2.70.0040.00417.88
8.2.60.0050.00317.92
8.2.50.0000.00818.07
8.2.40.0040.00418.28
8.2.30.0050.00318.31
8.2.20.0040.00417.94
8.2.10.0040.00418.03
8.2.00.0040.00417.93
8.1.280.0090.00625.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.01222.47
8.1.230.0060.00620.96
8.1.220.0060.00317.78
8.1.210.0030.00518.87
8.1.200.0000.01217.60
8.1.190.0060.00317.53
8.1.180.0000.00918.10
8.1.170.0040.00418.82
8.1.160.0040.00418.92
8.1.150.0040.00418.69
8.1.140.0060.00317.53
8.1.130.0030.00317.79
8.1.120.0000.00717.63
8.1.110.0040.00417.61
8.1.100.0040.00417.59
8.1.90.0000.00717.70
8.1.80.0000.00717.53
8.1.70.0000.00717.62
8.1.60.0040.00417.77
8.1.50.0080.00017.52
8.1.40.0030.00617.57
8.1.30.0080.00017.83
8.1.20.0040.00417.78
8.1.10.0000.00817.74
8.1.00.0000.00817.73
8.0.300.0040.00420.10
8.0.290.0000.00717.00
8.0.280.0000.00718.50
8.0.270.0000.00717.27
8.0.260.0030.00316.91
8.0.250.0040.00417.02
8.0.240.0000.00817.06
8.0.230.0040.00417.18
8.0.220.0070.00017.04
8.0.210.0000.00717.07
8.0.200.0060.00017.16
8.0.190.0080.00017.09
8.0.180.0040.00417.09
8.0.170.0050.00316.98
8.0.160.0000.00716.96
8.0.150.0000.00817.01
8.0.140.0000.00716.98
8.0.130.0030.00313.49
8.0.120.0050.00217.04
8.0.110.0040.00416.87
8.0.100.0000.00816.93
8.0.90.0000.00717.02
8.0.80.0120.00317.02
8.0.70.0050.00217.05
8.0.60.0000.00716.89
8.0.50.0030.00517.06
8.0.30.0090.01417.33
8.0.20.0060.01217.38
8.0.10.0000.00817.20
8.0.00.0130.00516.99
7.4.330.0030.00213.21
7.4.320.0000.00916.68
7.4.300.0030.00316.60
7.4.290.0030.00316.80
7.4.280.0030.00416.73
7.4.270.0030.00316.64
7.4.260.0000.00513.45
7.4.250.0060.00316.63
7.4.240.0030.00316.76
7.4.230.0070.00016.86
7.4.220.0160.00716.60
7.4.210.0080.00916.78
7.4.200.0050.00316.54
7.4.190.0040.00416.76
7.4.160.0090.00916.87
7.4.150.0140.00416.63
7.4.140.0110.01016.71
7.4.130.0130.00916.72
7.4.120.0080.00916.81
7.4.110.0130.00316.58
7.4.100.0090.00916.86
7.4.90.0120.00616.70
7.4.80.0140.00416.83
7.4.70.0060.01216.88
7.4.60.0110.01116.75
7.4.50.0030.00616.73
7.4.40.0070.00716.38
7.4.30.0080.00816.83
7.4.00.0070.01015.30
7.3.330.0030.00313.61
7.3.320.0030.00313.52
7.3.310.0080.00016.61
7.3.300.0080.00016.48
7.3.290.0000.01416.55
7.3.280.0060.01216.53
7.3.270.0090.00916.54
7.3.260.0090.00816.53
7.3.250.0040.01416.80
7.3.240.0060.01616.48
7.3.230.0100.00616.61
7.3.210.0120.00616.76
7.3.200.0100.00719.39
7.3.190.0110.01116.87
7.3.180.0160.00016.47
7.3.170.0130.00316.43
7.3.160.0140.00316.66
7.3.120.0100.00715.13
7.3.110.0100.00715.05
7.3.100.0000.01515.22
7.3.90.0030.00915.20
7.3.80.0040.01114.77
7.3.70.0060.00615.04
7.3.60.0040.00714.90
7.3.50.0100.00015.07
7.3.40.0000.01114.91
7.3.30.0060.00615.15
7.3.20.0000.00916.62
7.3.10.0140.00017.07
7.3.00.0040.01116.66
7.2.330.0090.00916.83
7.2.320.0100.00716.89
7.2.310.0110.01217.02
7.2.300.0110.00616.94
7.2.290.0070.01016.90
7.2.250.0110.00815.16
7.2.240.0060.01315.35
7.2.230.0000.01515.38
7.2.220.0030.01015.35
7.2.210.0030.00615.46
7.2.200.0040.00814.97
7.2.190.0040.00415.29
7.2.180.0160.00015.14
7.2.170.0060.00315.34
7.2.00.0070.00719.56
7.1.330.0030.00816.03
7.1.320.0100.00315.68
7.1.310.0050.00515.77
7.1.300.0000.01415.96
7.1.290.0000.01515.89
7.1.280.0070.00716.03
7.1.270.0040.01115.96
7.1.260.0070.00715.91
7.1.100.0100.00318.41
7.1.70.0030.00617.13
7.1.60.0120.00619.40
7.1.50.0040.00717.17
7.1.00.0030.07022.33
7.0.200.0350.01015.00
7.0.140.0070.07321.92
7.0.120.0070.06022.04
7.0.60.0130.07720.11
7.0.50.0070.04717.82
7.0.40.0070.05720.03
7.0.30.0230.04020.25
7.0.20.0370.06020.18
7.0.10.0200.06320.27
7.0.00.0030.06720.27
5.6.280.0030.09021.06
5.6.210.0130.07720.49
5.6.200.0100.05318.18
5.6.190.0070.07720.54
5.6.180.0530.03720.60
5.6.170.0270.04320.54
5.6.160.0100.05320.46
5.6.150.0070.05318.29
5.6.140.0070.05018.19
5.6.130.0130.07718.16
5.6.120.0130.07721.17
5.6.110.0000.04721.02
5.6.100.0070.04020.91
5.6.90.0200.07320.95
5.6.80.0130.07720.53
5.6.70.4430.04020.42
5.5.350.0370.08020.43
5.5.340.0070.08017.97
5.5.330.0100.07720.42
5.5.320.0270.06320.57
5.5.310.0170.08020.25
5.5.300.0030.05317.95
5.5.290.0000.04717.95
5.5.280.0070.08320.80
5.5.270.0000.08020.80
5.5.260.0030.09020.78
5.5.250.0170.06720.70
5.5.240.0030.06320.29
5.4.450.0070.08019.54
5.4.440.0130.05019.53
5.4.430.0030.08719.56
5.4.420.0130.05719.32
5.4.410.0030.07319.04
5.4.400.0070.04018.98
5.4.390.0030.04018.88
5.4.380.0100.07019.14
5.4.370.0030.08019.20
5.4.360.0100.07319.11
5.4.350.0170.07018.87
5.4.340.0070.04019.00
5.4.320.0030.07019.16
5.4.310.0000.08018.85
5.4.300.0130.03318.85
5.4.290.0000.08018.84
5.4.280.0130.07718.85
5.4.270.0030.07019.15
5.4.260.0000.04019.23
5.4.250.0070.07019.20
5.4.240.0070.05719.14
5.4.230.0100.04719.11
5.4.220.0130.06019.24
5.4.210.0070.06718.97
5.4.200.0130.06319.14
5.4.190.0100.07018.84
5.4.180.0100.06718.91
5.4.170.0070.07019.23
5.4.160.0130.07319.10
5.4.150.0030.08018.84
5.4.140.0130.04016.42
5.4.130.0070.04316.39
5.4.120.0030.07716.44
5.4.110.0030.07016.42
5.4.100.0100.07016.54
5.4.90.0170.06716.52
5.4.80.0070.07716.45
5.4.70.0100.07016.53
5.4.60.0070.07016.27
5.4.50.0130.04716.64
5.4.40.0200.06316.37
5.4.30.0100.06016.48
5.4.20.0000.07016.42
5.4.10.0070.07016.41
5.4.00.0030.04715.84
5.3.290.0070.07314.73
5.3.280.0000.08014.67
5.3.270.0100.07314.78
5.3.260.0100.06014.66
5.3.250.0070.04314.68
5.3.240.0070.03714.68
5.3.230.0100.04314.67
5.3.220.0170.07014.50
5.3.210.0030.04714.60
5.3.200.0100.07014.75
5.3.190.0200.06314.65
5.3.180.0030.08014.51
5.3.170.0070.03714.64
5.3.160.0070.06314.64
5.3.150.0070.06314.59
5.3.140.0000.05714.46
5.3.130.0100.06014.66
5.3.120.0030.07314.48
5.3.110.0100.06014.46
5.3.100.0100.03314.10
5.3.90.0030.04714.04
5.3.80.0070.06714.01
5.3.70.0100.04714.11
5.3.60.0070.07714.00
5.3.50.0070.07013.96
5.3.40.0070.07313.89
5.3.30.0100.07013.94
5.3.20.0070.06713.86
5.3.10.0070.06313.74
5.3.00.0170.06313.66
5.2.170.0070.03011.17
5.2.160.0100.03011.23
5.2.150.0030.06011.06
5.2.140.0100.06311.17
5.2.130.0070.05311.13
5.2.120.0100.06011.05
5.2.110.0030.03711.16
5.2.100.0070.06011.21
5.2.90.0000.04011.13
5.2.80.0030.07011.16
5.2.70.0030.03311.11
5.2.60.0070.05711.12
5.2.50.0030.04711.09
5.2.40.0070.04010.98
5.2.30.0030.03310.96
5.2.20.0070.04311.04
5.2.10.0130.02711.03
5.2.00.0030.06010.75
5.1.60.0130.02010.04
5.1.50.0070.04310.09
5.1.40.0030.03010.03
5.1.30.0030.05710.36
5.1.20.0000.03310.38
5.1.10.0070.04010.15
5.1.00.0000.03310.07
5.0.50.0030.0209.46
5.0.40.0000.0279.46
5.0.30.0070.0379.46
5.0.20.0070.0409.46
5.0.10.0030.0379.46
5.0.00.0030.0339.46
4.4.90.0070.0309.46
4.4.80.0030.0309.46
4.4.70.0030.0209.46
4.4.60.0030.0239.46
4.4.50.0070.0339.46
4.4.40.0070.0409.46
4.4.30.0030.0209.46
4.4.20.0000.0379.46
4.4.10.0030.0179.46
4.4.00.0030.0509.46
4.3.110.0030.0339.46
4.3.100.0030.0339.46
4.3.90.0030.0179.46
4.3.80.0030.0439.46
4.3.70.0000.0209.46
4.3.60.0030.0239.46
4.3.50.0030.0179.46
4.3.40.0070.0239.46
4.3.30.0070.0339.46
4.3.20.0030.0209.46
4.3.10.0000.0379.46
4.3.00.0030.0309.46

preferences:
44.97 ms | 401 KiB | 5 Q