PHP 5.4 new output control API callback buffer
| From: | Charles | Date: | Tue, 06 Mar 2012 05:22:33 +0000 |
| Subject: | PHP 5.4 new output control API callback buffer | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-316921@lists.php.net to get a copy of this message | ||
Hi,
I'm just wondering, what is the right output of below code should be
ob_start(function($o) { fwrite(STDERR, $o); });
echo 'hello';
ob_end_clean();
Does it should print "hello" or does it should print nothing?
In PHP 5.3, it prints hello, but in 5.4.0 it prints nothing.
Looking at the C code of PHP 5.4, it explicitly discards the output
buffer before calling the callback, except when flushing
or when using the internal callback handler.