From: [EMAIL PROTECTED] Operating system: Windows 2000 SP2 PHP version: 4.2.1 PHP Bug Type: Unknown/Other Function Bug description: register_shutdown_function() timeout problem
REGISTER_SHUTDOWN_FUNCTION() doesn't work on TIMEOUT for the Win32 platform. I've tried this under PHP versions 4.1.1 and 4.2.1 -- same thing happens. Here's a sample script: 1: ?> 2: 3: set_time_limit(1); 4: 5: function clean_up() 6: { 7: print("Script Terminated\n"); 8: } 9: 10: register_shutdown_function("clean_up"); 11: 12: while(1); 13: 14: ?> Here's the error: ----------------- Fatal error: Maximum execution time of 1 second exceeded in C:\timeout_code.php on line 7 When this script TIMES-OUT, the REGISTER_SHUTDOWN_FUNCTION() will "attempt" to run the function "clean_up" but will *immediately* generate the error above in the 1st line (line 7, in this case) of the "clean_up" function -- no matter what it is, and then the script terminates. Now -- if I use the REGISTER_SHUTDOWN_FUNCTION() with an EXIT (instead of a TIMEOUT), the function works fine... it *just* seems to be a TIMEOUT issue. The REGISTER_SHUTDOWN_FUNCTION() needs to ignore the TIMEOUT (timer??) -- and proceed to run any code it's programmed to run. Just a Note: I understand that PRINT() and a few other functions will not work when a REGISTER_SHUTDOWN_FUNCTION() is called and *run* SERVER-SIDE -- however, I am running this script from the COMMAND-LINE and PRINT() does work here, even with a REGISTER_SHUTDOWN_FUNCTION() -- so PRINT() isn't the problem... Just for giggles, I've replaced the PRINT() function with an ERRORLOG() function, in an attempt to write the output to disk -- SAME ERROR and exits on line 7 -- never executing the code. Thanks Jason Caldwell [EMAIL PROTECTED] -- Edit bug report at http://bugs.php.net/?id=17461&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17461&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17461&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17461&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17461&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17461&r=support Expected behavior: http://bugs.php.net/fix.php?id=17461&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17461&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17461&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17461&r=globals