PHP has a large number of batteries-included functions, e.g. functions on arrays. Some of these, like each
, are present in get_defined_functions()['internal']
. Others, like reset
and many others, are not present at all. However, they are treated as functions in every other way: they are not documented as "language constructs" or keywords; I can call them using the "variable function" feature; function_exists("reset")
returns true; if I try to redefine them (e.g. function reset() { ... }
), I get an error about redeclaration, rather than a syntax error; and so on.
Why are these functions not listed by get_defined_functions
? Are they not actually functions? If not, what are they? If they are functions, then what actually is it that get_defined_functions
is listing? In either case, how do I list the things that don't appear in get_defined_functions
?