So I have this extremely simple script:
echo "lalalaal";
ob_start();
var_dump(headers_sent());
echo "heretoo";
$html = ob_get_contents();
ob_end_clean();
echo $html;
And it is being run from the command line with:
php n.php
at all times.
I have two servers:
- My dev server has PHP 5.3.10-1ubuntu3.9 with Suhosin-Patch (cli)
- My live server has PHP 5.5.9-1+sury.org~precise+1 (cli)
The output on my dev server is:
lalalaal
bool(false)
heretoo
On my live server:
lalalaal
bool(true)
heretoou
I am showing all errors on both servers, why is my live server returning true
? What has changed since 5.3 to cause this?
Edit
With var_dumping the results from headers_sent it just tells me that lalalaal causeed it:
lalalaalbool(true)
string(18) "/home/ubuntu/n.php"
int(4)
int(4)
pointing to echo "lalalaal";
since it sits under a PHP tag and then a blank line then a comment.