php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26024 Add function handler for set_time_limit()
Submitted: 2003-10-28 18:45 UTC Modified: 2010-11-24 09:04 UTC
From: seventhcycle at yahoo dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.3 OS: linux
Private report: No CVE-ID: None
 [2003-10-28 18:45 UTC] seventhcycle at yahoo dot com
Description:
------------
It would be nice to have an optional function handler for when set_time_limit() goes over the set amount of time.

Reproduce code:
---------------
<?

   set_time_limit(30, "errfunc");
   while(1) { $g=1; }

   function errfunc()
   {
      echo "Hey, this is taking too long!";
      exit;
   }
?>

Expected result:
----------------
After 30 seconds, errfunc() is called, and the program executes gracefully, without an error message and a line number.

This would be useful, say, if doing a merchant transaction with a separate server and it's stalling on giving a response.

Actual result:
--------------
Hey, this is taking too long

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 09:04 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-11-24 09:04 UTC] jani@php.net
Use register_shutdown_function() together with connection_status(). See also: 

  http://www.php.net/manual/en/features.connection-handling.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 18:01:32 2024 UTC