From: rewilliams at newtekemail dot com Operating system: PHP version: 5.5.0RC2 Package: Scripting Engine problem Bug Type: Bug Bug description:ob_start() fails when passed default parameters
Description: ------------ Calling ob_start() with explicit parameters that match the defaults (using null to get past the first one, as documented), the various functions to end output buffering generate notices, which are also added to the buffered content. For example, ob_get_clean() returns the following: ob_get_clean(): failed to discard buffer of default output handler [...] ob_get_clean(): failed to delete buffer of default output handler (0) in [...] It looks like output is spit out just as though buffering were not enabled, *and* the buffer gets saved - albeit with the buffering-related notices mixed in. Testing at <http://sandbox.onlinephpfunctions.com>, it appears the bug was introduced in 5.4 (it works in 5.3.23) and continues through the latest version of 5.5. Test script: --------------- <?php ob_start(null, 0, true); echo 'hello world'; $foo = ob_get_clean(); var_dump($foo) ?> Expected result: ---------------- string(11) "hello world" Actual result: -------------- PHP Notice: ob_get_clean(): failed to discard buffer of default output handler (0) in [...] on line 5 PHP Notice: ob_get_clean(): failed to delete buffer of default output handler (0) in [...] on line 5 hello world Notice: ob_get_clean(): failed to discard buffer of default output handler (0) in [...] on line 5 Notice: ob_get_clean(): failed to delete buffer of default output handler (0) in [...] on line 5 string(11) "hello world" -- Edit bug report at https://bugs.php.net/bug.php?id=64977&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64977&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64977&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64977&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64977&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64977&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64977&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64977&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64977&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64977&r=support Expected behavior: https://bugs.php.net/fix.php?id=64977&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64977&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64977&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64977&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64977&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64977&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64977&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64977&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64977&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64977&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64977&r=mysqlcfg