// VERY BEGIN OF SCRIPT
$_SERVER[\'HX_startTime\'] = microtime(true);
...
// MY SHUTDOWN FUNCTION
register_shutdown_function(\'HX_shutdownFn\');
function HX_shutdo
I'm assuming there's more code to this than you posted - in that case if you're transferring any output to the client, the script won't shutdown until it's been sent.
There may also be additional shutdown functions registered which you might be unaware of as mentioned by the comments.
If all else fails, try isolating this script (so ONLY the lines you posted, even without whatever substitutes the ...
) and compare running it from command line and your web server. There might be some server-specific overhead involved.