xp_on_shutdown

xp_on_shutdown($function)

Registers a function to call when the processor shuts down.

Parameters:callable|object – Function or process object
Return type:object XPSPLProcess

Example #1 Basic Usage

<?php

xp_on_shutdown(function(){
    echo 'Shutting down the processor!';
});

xp_wait_loop();

The above code will output.

Shutting down the processor!