Output buffering

From: Date: Wed, 07 Oct 2009 07:37:30 +0000
Subject: Output buffering
Groups: php.general 
Request: Send a blank email to php-general+get-298709@lists.php.net to get a copy of this message
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

« previous php.general (#298709) next »