ID:               22945
 Updated by:       [EMAIL PROTECTED]
 Reported By:      michael at heuser dot dk
-Status:           Open
+Status:           Closed
 Bug Type:         Output Control
 Operating System: linux
 PHP Version:      4.3.1
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




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

[2003-03-28 18:14:37] michael at heuser dot dk

When turning on output buffering and setting a call back function
like:
        ob_start('callback_function');
The function is called right away. Not just in the end of the script.

Try this sample:
        ob_start('ob_gzhandler');
        ob_end_clean();

        echo "Step 1<br>\n";
        flush();
        sleep(1);

        echo "Step 2<br>\n";
        flush();

Function ob_end_clean should cancel the buffering and it dose, but
ob_gzhandler is already called. It is called when ob_start is turned
one. Now the script fails because the function ob_gzhandler has already
set Content-Encoding header (meaning the browser expects compressed
content).

A simple one:
        function callback_function($content) {
                die("Stop!");
                return $content;
        }
        ob_start('callback_function');
        ob_end_clean();

        echo "Step 1<br>\n";
        flush();
        sleep(1);

        echo "Step 2<br>\n";
        flush();

The script is stops before ob_end_clean is called.

I think that the problem is general. I have tested the problem on more
than one computer.
The newest installation was a preinstalled Red Hat with a PHP version
4.3.1



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


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

Reply via email to