ID:               48552
 Updated by:       [email protected]
 Reported By:      cagret at gmail dot com
-Status:           Open
+Status:           Bogus
-Bug Type:         Unknown/Other Function
+Bug Type:         *General Issues
 Operating System: Win/Linux/Apache/Lighttpd
 PHP Version:      5.2.9
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2009-06-15 03:07:24] cagret at gmail dot com

Description:
------------
Function registered with register_shutdown_function() sometimes is
executed / sometimes it is not, after you exit (outside of registered
function) - depends on php configuration.

Win+Apache+php5 as mod - shutdown.txt IS NOT created.
Win+Apache+php5 as cgi - shutdown.txt IS created
Win+Apache+php4 as mod - shutdown.txt IS created
Win+Lighttpd+php5 as fcgi - shutdown.txt IS created
Linux+Apache+php4 as mod - shutdown.txt IS created
Linux+Lighttpd+php5 as fcgi - shutdown.txt IS created

I've thought this is a bug on Win+Apache+php5asmod, and reported it,
but [email protected] (http://bugs.php.net/bug.php?id=48475) says it is an
expected behavior: "Expected behaviour. exit() is supposed to exit
immediately. Nothing is supposed to be run after you call exit."

If this is an expected behavior, then seems like there is a bug on
other php configurations.

Reproduce code:
---------------
<?php
function shutdown()
{
        file_put_contents(dirname(__FILE__).'/shutdown.txt', time());
}
register_shutdown_function('shutdown');
exit();
?>

Expected result:
----------------
shutdown.txt should not be created.

Actual result:
--------------
shutdown.txt is created


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48552&edit=1

Reply via email to