Output buffering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Has there been a change to the way output buffering works? 

The manual states for ob_get_contents()
"This will return the contents of the output buffer or FALSE, if output
buffering isn't active."

But the following works in php4.4.4 and php5.2.6 whether output buffering is
on or not

<?php
  ob_start();
  echo "<html><body>";
  echo "output_buffering is ";
  echo ini_get('output_buffering')?"on":"off";
  echo "</body></html>";
  $check = ob_get_contents();
  if ($check === FALSE)
    echo " FALSE";
  $info = ob_get_contents();
  ob_clean();
  echo $info." -2-";
  ob_flush();
?>

The output is "output_buffering is off -2-" (or on) displayed once - "FALSE"
is obviously never appended.

According to the manual I shouldn't see anything at all when
output_buffering is off (or if memory serves me correctly I should see an
error about "headers already sent" or something). Looking at phpinfo
confirms the value echoed by the script. Has something changed with output
buffering?

Cheers
Arno


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux