create shutdown function php code example Example: php shutdown function register_shutdown_function(function () { # code });