Edit report at https://bugs.php.net/bug.php?id=64240&edit=1
ID: 64240 Updated by: m...@php.net Reported by: nath...@php.net Summary: Output Buffering does not work with Connection Handling -Status: Open +Status: Not a bug Type: Bug Package: Output Control Operating System: N/A PHP Version: 5.4.11 -Assigned To: +Assigned To: mike Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2013-02-18 21:08:50] nath...@php.net Description: ------------ While an output buffer is in place the functions connection_aborted() and connection_status() will not return proper information. (I have only tested in apache2) INSTRUCTIONS ON TEST SCRIPT: In a terminal run "tail -f /tmp/test.tmp" put script in www accessible directory, run the script from a browser and within a second or two stop the connection or close browser. Watch the terminal for actions to take place. (comment out the ob_start() function to see how it should react) Test script: --------------- <?php ignore_user_abort(true); ob_flush(); flush(); // Comment this out to see it work properly ob_start(function ($data, $mode){ return $data; }, 1); $i=0; for($i=0;$i++<200;){ echo "----"; ob_flush(); flush(); if(connection_aborted()){ file_put_contents('/tmp/test.tmp', sprintf("Conn Closed\nLoop itterations: %s\n\n", $i), FILE_APPEND); exit; } usleep(50000); } file_put_contents('/tmp/test.tmp', "Timeout\n\n", FILE_APPEND); ?> Expected result: ---------------- Conn Closed Loop itterations: %i Actual result: -------------- Timeout ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64240&edit=1