Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

register_shutdown_function

Description

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
HomeMenu