Answer the question
In order to leave comments, you need to log in
Is it possible to determine if a method is static or not?
Good evening.
There is some class with a set of static and normal methods.
class MyClass
{
public static function methodA(){
...
}
public function methodB(){
...
}
}
$data = [
"class"=> "MyClass",
"method"=> "methodA"
];
Answer the question
In order to leave comments, you need to log in
(new ReflectionMethod('MyClass', 'methodA'))->isStatic();
call_user_func([$object, 'method']);
call_user_func(['ClassName', 'staticMethod']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question