implicit ob_start in require_once

158 views Asked by At

Somewhere in my PHP script, a call to ob_start() is issued, and I am trying to find where exactly. To do this, I use xdebug, and proceed by dichotomy, calling ob_get_contents() which returns FALSE as long as ob_start() hasn't been called.

I have narrowed my code to:

<?php 
...
if ( ob_get_contents() ) { xdebug_break(); }
require_once( 'lib/local.php' );
if ( ob_get_contents() ) { xdebug_break(); }
...
?>

lib/local.php is a local, writeable file that contains nothing else than defines.

Now the funny part is this: if I replace require_once( 'lib/local.php' ) with the contents of lib/local.php, the second ob_get_contents() returns FALSE, as expected.

Now I am really puzzled at what's going on here. Insight, anyone?

0

There are 0 answers