The get_defined_functions
method can be used to get a list of user-defined functions and built-in functions.
get_defined_functions(bool $exclude_disabled = true): array
We can use the exclude_disabled
argument to include disabled functions from the returned functions. By default, the disabled functions are excluded.
This method returns a multidimensional array with a user-defined function with key user
and a built-in function with key internal
.
<?phpfunction test(){echo "hi";}$arr = get_defined_functions();echo "User defined in Functions\n";var_export($arr['user']);echo "\n\nBuild in Functions\n";var_export($arr['internal']);?>
In the code above, we created a function with the name test
. Then we called the get_defined_functions
method to get the list of user-defined and built-in functions.