register_shutdown_function
Function • Return type changed in PHP 8.2
Register a function for execution on shutdown.
register_shutdown_function
Function synopsis
register_shutdown_function(callable $callback, mixed ...$args): void
Parameters
$callback
Typecallable
The shutdown callback to register.
$args
Variadic, OptionalTypemixed
It is possible to pass parameters to the shutdown function by passing additional parameters.
Return value
The register_shutdown_function
function is a void
function; it does not return any values.
Changes to the register_shutdown_function
Function
PHP 8.2
- Return type changed:
?bool
tovoid
- register_shutdown_function(callable $callback, mixed ...$args): ?bool
+ register_shutdown_function(callable $callback, mixed ...$args): void
PHP 8.0
- Return type added:
?bool
- Parameter name of parameter #1 changed:
$function_name
to$callback
- Parameter type added for parameter #1 (
$callback
):callable
- Parameter name of parameter #2 changed:
$parameters
to$args
- Parameter type added for parameter #2 (
$args
):mixed
- register_shutdown_function($function_name, ...$parameters)
+ register_shutdown_function(callable $callback, mixed ...$args): ?bool
PHP 5.6
- Optional parameter added - #2:
$parameters
- register_shutdown_function($function_name)
+ register_shutdown_function($function_name, ...$parameters)
register_shutdown_function
Function Availability
register_shutdown_function
Function AvailabilityPHP Version | Availability |
---|---|
PHP 8.5Upcoming Release | Yes |
PHP 8.4Supported (Latest) | Yes |
PHP 8.3Supported | Yes |
PHP 8.2Security-Fixes Only | Yes |
PHP 8.1Security-Fixes Only | Yes |
PHP 8.0Unsupported | Yes |
PHP 7.4Unsupported | Yes |
PHP 7.3Unsupported | Yes |
PHP 7.2Unsupported | Yes |
PHP 7.1Unsupported | Yes |
PHP 7.0Unsupported | Yes |
PHP 5.6Unsupported | Yes |
PHP 5.5Unsupported | Yes |
PHP 5.4Unsupported | Yes |
PHP 5.3Unsupported | Yes |