ID: 33910 Updated by: [EMAIL PROTECTED] Reported By: jrweir at gmail dot com Status: Bogus Bug Type: Output Control Operating System: all PHP Version: 5.1.0b3 New Comment:
Actually this has nothing to do with bug #33772. And the current shutdown order is the right one, it was broken before. Previous Comments: ------------------------------------------------------------------------ [2005-07-29 01:59:50] [EMAIL PROTECTED] 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. See bug #33772 ------------------------------------------------------------------------ [2005-07-28 23:07:12] jrweir at gmail dot com Exactly, it had never worked until he requested it to work. That was an example of code that did not work, but does now because the shutdown order was changed (which in turn broke a bunch of people's code that was running under the assumption of a different shutdown order). Before bug #30578: - 0 people had working code that assumed ob flush ran after destruct because it didn't (one guy wanted it to though, so he reported it as a bug - but the bug solution should have been to disallow ob in destructors since they run after the flush in php 5.0) - Many people had code that assumed ob flush ran before destruct After bug #30578: - 0 people have code that assumes ob flush ran after destruct (because it never did before, except for the guy that requested the "bug fix" because he just wanted the behaviour changed for his convienence. The php developer didn't think about the side effects it would cause when they changed the order.) - Many people now have code that doesn't work because they understood the shutdown order and leveraged it to their advantage. It seems to me that when you go stable with 5.1 and the shutdown order is switched, all the people who upgrade from 5.0 that didn't give 5.1b a test are going to be in for a suprise if their code depends on the old shutdown order. ------------------------------------------------------------------------ [2005-07-28 21:54:58] [EMAIL PROTECTED] >Since calling ob_end*() in a destructor has never worked >nobody has code written expecting it to. This is obviously not true and you know why: see bug #30578. ------------------------------------------------------------------------ [2005-07-28 19:41:39] jrweir at gmail dot com Currently in 5.1.0b3 the order is 1. call destructors 2. call shutdown functions 3. flush output buffers I think it should be 1. flush output buffers 2. call destructors 3. call shutdown functions Reason: Since calling ob_end*() in a destructor has never worked nobody has code written expecting it to. However, many people (as in bug #33772) have code written expecting destructors to run after output buffering. I'd say there are just as many valid reasons to flush buffers after the destructors run as there are to flush buffers before they run, but since it was the latter way since php 5, why change it? Solution: Make it illegal to do output buffering in a destructor just as it is in an output buffering handler. ------------------------------------------------------------------------ [2005-07-28 19:13:47] [EMAIL PROTECTED] This is a chicken-and-egg problem that can't be solved in an easy way. Please see bug #33772 for additional details. If you have any ideas what should be the *right* order of calls - please tell your opinion. But remember that we have a lot of different handlers that are called on shutdown. See the current order in php-src/main/main.c, php_request_shutdown() function. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33910 -- Edit this bug report at http://bugs.php.net/?id=33910&edit=1