Re: Timeout Function
| From: | Wico de Leeuw | Date: | Wed, 25 Apr 2001 09:04:20 +0000 |
| Subject: | Re: Timeout Function | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-52368@lists.php.net to get a copy of this message | ||
At 13:53 24-4-2001 -0700, Rasmus Lerdorf wrote:
I would like to see a timeout function implemented in PHP (something like Perl's alarm function would be perfect). I notice there is a set_time_limit() function in PHP, but it cannot be applied to a specified block of code (it applies to the entire script) and it causes a fatal error when the timeout is reached (instead of letting you run some alternate code if the timeout is reached). That's not true. If you use register_shutdown_function() then this function you register will be run once the timeout hits. See the chapter in the manual on connection handling.But you can't continue normally from within the register_shutdown_function (output to browser and stuff) You can't use it more than once etc. I think it's a good option (and submitted a feature request a long time ago for that) http://www.php.net/bugs.php?id=3830 Greetz, Wico
-Rasmus -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net