note 33778 added to function.ob-implicit-flush

From: Date: Mon, 07 Jul 2003 17:00:07 +0000
Subject: note 33778 added to function.ob-implicit-flush
Groups: php.notes 
Request: Send a blank email to php-notes+get-51642@lists.php.net to get a copy of this message
######### BEWARE ########## There is a bug (or at least an unexpected feature of ob_implicit_flush) that has been already discussed on the PHP bugtracker : http://bugs.php.net/bug.php?id=23877 http://bugs.php.net/bug.php?id=16676 Code like this WILL NOT work : <? // This will not work as expected on Linux. ob_implicit_flush (1); for($i=0;$i<10;$i++) { echo "grrrrrrrrrr\n"; sleep(1); } ?> This feature happens on Linux versions of PHP, in all versions of php4 prior to 4.3.3 (don't know yet for the next ones) but also in php5 beta1. ob_implicit_flush has NO EFFECT on command-line (console, CLI) scripts, no flushing at all will be made, all output will be sent at the end of the script. There is a workaround using ob_end_flush() and ob_flush, here it is : <? // This works ! ob_end_flush(); for($i=0;$i<10;$i++) { echo "yeah :-))))\n"; @ob_flush(); sleep(1); } ?> hope this will help. It would have helped me... ---- Manual Page -- http://www.php.net/manual/en/function.ob-implicit-flush.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33778 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33778&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33778&report=yes

« previous php.notes (#51642) next »