ID: 21513
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: WinXP
PHP Version: 4.3.0
New Comment:
This script works just fine for me (using CLI):
<?php
error_log ("Start\n", 3, "test.log");
function boo()
{
error_log ("Shutdown - function 'foo'\n", 3, "test.log");
}
register_shutdown_function("boo");
/* not necessary, just to show the error sooner */
set_time_limit(1);
/* infinite loop to simulate long processing */
for (;;) {}
error_log ("\nEnd\n", 3, "test.log");
?>
In test.log I have now:
----cut----
Start
Shutdown - function 'foo'
----cut----
Which is the expected output.
Can you try this script?
Previous Comments:
------------------------------------------------------------------------
[2003-01-08 02:53:17] [EMAIL PROTECTED]
This problem is absolutely critical if you do DB cleanups, transactions
processing or other similar things in shutdown functions. Can be
especially bad if you need to commit/rollback transactions with
persistent DB connections.
----------
<?php
function boo()
{
...do_anything...; // never ever gets called
}
register_shutdown_function("boo");
set_time_limit(3); // not necessary, just to show the error sooner
for (;;) { // infinite loop to simulate long processing
}
?>
----------
Error message:
Fatal error: Maximum execution time of 3 seconds exceeded in c:\exp.php
on line 10
Fatal error: Maximum execution time of 3 seconds exceeded in c:\exp.php
on line 4
Does not depend on whether we run script as CGI/SAPI or CLI.
Report #14542 looks similar but is different IMHO.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21513&edit=1