Is there a built-in class function which instances are the standard PHP functions? Are PHP functions objects?
In Python I can test it in this way:
from inspect import isclass
def foo():
pass
isclass(type(foo))
>>> True
What about this function in PHP:
function foo(){
return null;
}
fooexample are not a class in PHP, but a language construct. Pretty much likeiforinterface. As Carlos pointed out, PHP automatically transforms a function assigned to a variable into an instance of the class Closure.