PHP get_defined_functions() Function Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report The get_defined_functions() function is an inbuilt function in PHP which returns the all defined functions in the array format. Syntax: array get_defined_functions( bool $exclude_disabled = true )Parameters: This function accepts one parameter that is described below: $exclude_disabled: It will check whether the disabled functions will be excluded from the return value i.e. if the function is false, it returns a value otherwise it will return the full definition of the function.Return value: The return value will be a multidimensional array that has the list of all defined functions(ie., both built-in and user-defined). This function returns a definition of the function or returns the value of the function if the parameter will be true. Example 1: In this example, we demonstrated the get_defined_functions() function. PHP <?php function hello_world(){ echo "GeeksforGeeks"; } $arr = get_defined_functions(); print_r($arr); ?> Output: Array( [internal] => Array ( [0] => zend_version [1] => func_num_args [2] => func_get_arg [3] => func_get_args [4] => strlen [5] => strcmp [6] => strncmp [7] => strcasecmp [8] => strncasecmp [9] => error_reporting [10] => define [11] => defined} [user] => Array ( [0] => hello_world ) ) Example 2: In this example, we will print only user-defined functions in an array form. PHP <?php function hello_world(){ echo "GeeksforGeeks"; } function bye_gfg(){ echo "Bye GeeksforGeeks" ; } $arr = get_defined_functions(); print_r($arr["user"]); ?> Output: Array( [0] => hello_world [1] => bye_gfg) Reference: https://www.php.net/manual/en/function.get-defined-functions.php Comment More infoAdvertise with us Next Article PHP get_defined_functions() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-Function-handling Similar Reads PHP | function_exists() Function The function_exists() is an inbuilt function in PHP. The function_exists() function is useful in case if we want to check whether a function() exists or not in the PHP script. It is used to check for both built-in functions as well as user-defined functions. Syntax: boolean function_exists($function 2 min read PHP create_function() Function The create_function() is an inbuilt function in PHP which is used to create an anonymous (lambda-style) function in the PHP. Syntax: string create_function ( $args, $code ) Parameters: This function accepts two parameters which is describes below: $args: It is a string type function argument. $code: 2 min read PHP | get_defined_vars() Function The get_defined_vars() function is an inbuilt function in PHP which is used to returns an array of all defined variables. This function returns a multidimensional array which contains all the list of variables, environment etc. Syntax: array get_defined_vars( void ) Parameters: This function does no 1 min read PHP func_get_arg() Function The func_get_arg() function is an inbuilt function in PHP which is used to get a mentioned value from the argument passed as the parameters. Syntax: mixed func_get_arg( int $arg ) Parameters: This function accepts a single parameter as mentioned above and described below. $arg: This parameter holds 2 min read PHP | defined() function The PHP defined() function is an inbuilt function in PHP which checks whether a constant is exists or not, in other words, defined or not. Syntax: bool defined($constant_name); Parameter: This function accepts a single parameter as mentioned above and described below. $constant_name: This is require 1 min read Like