F.14. Function Handling

FunctionReturnsDescription
call_user_func(string function_name [, mixed parmeter] [, mixed ...])
mixedCalls a user function that is the first parameter.
call_user_func_array(string function_name, array parameters)
mixedCalls a user function that is the first parameter with the arguments contained in array.
call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
mixedCalls a user method on a specific object or class.
call_user_method_array(string method_name, mixed object, array params)
mixedCalls a user method on a specific object or class using a parameter array.
register_shutdown_function(string function_name)
voidRegisters a user-level function to be called on request termination.
register_tick_function(string function_name [, mixed arg [, mixed ... ]])
boolRegisters a tick callback function.
unregister_tick_function(string function_name)
voidUnregisters a tick callback function.
create_function(string args, string code)
stringCreates an anonymous function, and returns its name
function_exists(string function_name)
boolChecks if the function exists.
func_num_args(void)
intGets the number of arguments that were passed to the function.
func_get_arg(int arg_num)
mixedGets the $arg_num'th argument that was passed to the function.
func_get_args()
arrayGets an array of the arguments that were passed to the function.

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.