3 ms·
With the "callable" concept i meant, that many things are seen as callable: [$obj, "methodName"] => callable for $obj->methodName() "str_replace" => callable
by sandreas 8y ago
With the "callable" concept i meant, that many things are seen as callable:
[$obj, "methodName"] => callable for $obj->methodName()
"str_replace" => callable for function "str_replace"
["ClassName", "staticMethod"] => callable for ClassName::staticMethod()
"ClassName::staticMethod" => callable for ClassName::staticMethod()
function() {} => callable for a lambda
I would prefer a "ClassMethod" and a "Function" type, instead of using strings.
$x = phpinfo;
$x();
$y = $obj->method;
$y();
But i don't think, this is possible, because PHP supports global constants and function names cannot be distinguished from constants, especially because PHP is not case sensitive regarding functions and classnames.
But I see, that my karma has decreased with this post, so it seems, that not many are in my opinion...