PHP 5.6.0RC3 is available


(PHP 4, PHP 5)

ob_implicit_flushHabilitar/deshabilitar el volcado implícito


void ob_implicit_flush ([ int $flag = true ] )

ob_implicit_flush() habilitará o deshabilitará el volcado implícito. El volcado implícito resultará en una operación de volcado después de cada llamada que produzca salida, de modo que no son necesarias las llamadas explícitas a flush().



TRUE para habilitar el volcado implícito, FALSE para deshabilitarlo.

Valores devueltos

No devuelve ningún valor.

Ver también

  • flush() - Vaciar el búfer de salida del sistema
  • ob_start() - Activa el almacenamiento en búfer de la salida
  • ob_end_flush() - Volcar (enviar) el búfer de salida y deshabilitar el almacenamiento en el mismo

add a note add a note

User Contributed Notes 4 notes

Paul Yanchenko
8 years ago
There is another workaround for ob_implicit_flush() in console. Yes, it doesn't works as expected, but you can get similar result by specifying chunk_size=2 in ob_start():

('ob_logstdout', 2);

This will result that every new line (which ends with \n) will flush output buffer.

Hope this will help you.
calimero at Creatixnet dot com
11 years ago
######### BEWARE ##########

There is a bug (or at least an unexpected feature of ob_implicit_flush) that has been already discussed on the PHP bugtracker :

Code like this WILL NOT work :

// This will not work as expected on Linux.
ob_implicit_flush (1);
$i=0;$i<10;$i++) {

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 !
$i=0;$i<10;$i++) {
"yeah :-))))\n";

hope this will help. It would have helped me...
rocca at start dot ca
6 years ago
You can also get the unbuffered output with Linux/Apache without having to do the implicit flush after each line by calling:

ob_end_flush(); the start of the script.
mhumphrey at _spammenot_designvision dot com
10 years ago
From experimenting, it looks like using sessions with session.use_trans_sid=1 will force your output to be buffered regardless of this setting.

My guess is that this is so PHP can hunt for URLs in your output to automatically add the Session ID to them.  It must wait until script output is complete before it starts that replacement, rather than doing it "on the fly".

When i comment out my session_start() line, i get continuous output to the browser.  Put it back in, and i only see the page when it's completely loaded.  Change session.use_trans_sid = 0 and i get continuous output again.
To Top