function_exists

Return true if the given function has been defined

Syntax

function_exists(string $function): bool

Parameters

function

The function name, as a string.

Return

Returns true if function exists and is a function, false otherwise.

Note: This function will return false for constructs, such as include_once and echo.

Examples

<?

function myfunction()
{
}

$function = "myfunction";

$return = function_exists($function);

var_export($return);

?>
true

call_user_func

call_user_func_array

forward_static_call

forward_static_call_array

func_get_arg

func_get_args

func_num_args

get_defined_functions

register_shutdown_function

register_tick_function

unregister_tick_function

PHP

Home Menu