In response to K.Tomono and alexrussell101 at gmail dot com :
Yes,
headers_sent() will return false, even if you sent something to the ouptut using print() or header() , if output_buffering is different from Off in you php.ini, and the length of what you sent does not exceed the size of output_buffering.
To test it, try this code with these values in php.ini
1) output_buffering=32
2) output buffering = 4096
[code]
<?php
echo "Yo<br />";
echo "Sent:",headers_sent(),"<br />";
echo "enough text to feed the buffer until it overflows ;-)<br />";
echo "Sent:",headers_sent(),"<br />";
?>
[/code]
then put
3) output buffering = Off
and try this code
[code]
<?php
echo "Yo<br />";
echo "Sent:",headers_sent(),"<br />";
?>
[/code]
which will this time unconditionnally say that headers were sent.
This is noticed in php.ini comment :
"Output buffering allows you to send header lines (including cookies) even after you send body content, in the price of slowing PHP's output layer a bit."
Note : This is completly independant of implicit_flush tuning.