note 37638 deleted from function.register-shutdown-function by cmb

From: Date: Sun, 03 Feb 2019 18:08:00 +0000
Subject: note 37638 deleted from function.register-shutdown-function by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210186@lists.php.net to get a copy of this message
Note Submitter: gabe at websaviour dot com ---- It should be noted that register_shutdown_function() does not guarantee that the connection will be closed before executing the function. In particular on Apache 1.3.27 w/ PHP 4.3.0 on OS X as well as Apache 1.3.22 w/ PHP 4.1.2 on Red Hat I have discovered that Apache does not close the connection until after the registered shutdown function has completed execution. I am not sure what the circumstances that cause this are, but there is a bug at http://bugs.php.net/bug.php?id=20447 This is important, because as far as I can tell, the documented functionality of register_shutdown_function() is the *ONLY* way to achieve anything resembling asynchronous processing with PHP in a web server environment. In my mind this is a severe limitation, because if you have some processing intensive task that needs to be done and you want to do it in PHP, there is no way to have it occur without an accompanying wait in a browser window. Sure you can use ignore_user_abort() to ensure that processing doesn't get cancelled by an impatient user (or impatient browser for that matter), but usability is still compromised.

« previous php.notes (#210186) next »