From: anthony at ectrolinux dot com Operating system: Gentoo Linux PHP version: 5.0.2 PHP Bug Type: Zend Engine 2 problem Bug description: Severe misbehavior of script-based class destructors
Description: ------------ Some of the effects of this bug are outlined in the two bugs that are referenced at the end of this bug report. As neither of those bugs outline the actual, underlying cause of the problem, this bug shall do so. When working with script-based classes or derivations of built-in PHP classes, PHP prematurely executes the procedures that would be expected during script termination, before script termination actually occurs. As a result of this, before the destructors are called, output buffering is explicitly terminated, sessions are closed and other pieces of functionality that are integral to proper script execution are not available to properly shutdown the script. Script developers may work-around the bug by explicitly unsetting the class objects before they would normally go out of scope at the end of the script, however this method can easily be haphazardly implemented if there are lingering object references in other sections of the code. Reproduce code: --------------- See bugs: - #29032 - #30578 -- Edit bug report at http://bugs.php.net/?id=30992&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30992&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30992&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30992&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30992&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30992&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30992&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30992&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30992&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30992&r=support Expected behavior: http://bugs.php.net/fix.php?id=30992&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30992&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30992&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30992&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30992&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30992&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30992&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30992&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30992&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30992&r=mysqlcfg