register_shutdown_function

Register a function for execution on shutdown

Syntax

register_shutdown_function ( callable $callback [, mixed $... ] ) : void

Parameters

callback

The shutdown callback to register. The shutdown callbacks are executed as the part of the request, so it's possible to send output from them and access output buffers.

...

It is possible to pass parameters to the shutdown function by passing additional parameters.

Return

No value is returned.

Examples

1 · callback

<?

function myfunction()
{
    echo __FUNCTION__;
}

$callback = "myfunction";

register_shutdown_function($callback);

?>
myfunction

2 · ...

<?

function myfunction($parameter)
{
    echo __FUNCTION__ . " $parameter";
}

$callback = "myfunction";
$parameter = "myparameter";

register_shutdown_function($callback, $parameter);

?>
myfunction myparameter

call_user_func

call_user_func_array

forward_static_call

forward_static_call_array

func_get_arg

func_get_args

func_num_args

function_exists

get_defined_functions

register_tick_function

unregister_tick_function

PHP

Home Menu