Bug #64977 [Asn]: ob_start() fails when passed default parameters

From: Date: Wed, 19 Nov 2014 09:31:49 +0000
Subject: Bug #64977 [Asn]: ob_start() fails when passed default parameters
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11660@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64977&edit=1

 ID:                 64977
 Updated by:         mike@php.net
 Reported by:        rewilliams at newtekemail dot com
 Summary:            ob_start() fails when passed default parameters
 Status:             Assigned
 Type:               Bug
 Package:            Documentation problem
 PHP Version:        5.5.0RC2
 Assigned To:        aharvey
 Block user comment: N
 Private report:     N

 New Comment:

PHP_OUTPUT_HANDLER_STARTED just indicates that the handler has been called previously with
PHP_OUTPUT_HANDLER_START set, so it would not get that flag again, unless it has also seen
PHP_OUTPUT_HANDLER_FINAL in the meantime.

So:
handler(PHP_OUTPUT_HANDLER_START) => flags |= STARTED
handler(PHP_OUTPUT_HANDLER_FINAL) => flags ^= STARTED

PHP_OUTPUT_HANDLER_DISABLED: 
Internal output handlers can mark them self as disabled with
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE), when they f.e. detect an error; see
README.NEW-OUTPUT-API.
Also, when a call to an internal or userland handler fails, or the userland handler returns FALSE.


Previous Comments:
------------------------------------------------------------------------
[2013-10-01 18:37:07] aharvey@php.net

OK, documentation is done except for the PHP_OUTPUT_BUFFER_STARTED and 
PHP_OUTPUT_BUFFER_DISABLED constants, mostly because I can't figure out how 
they're useful.

Mike, help please? :)

------------------------------------------------------------------------
[2013-10-01 18:35:20] aharvey@php.net

Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=331632
Log: Document the ob_start() changes in PHP 5.4.

Mostly fixes doc bug #64977 (ob_start() fails when passed default parameters).

------------------------------------------------------------------------
[2013-09-27 18:44:22] aharvey@php.net

We probably should have picked that up at the time. Whoops.

OK, I'll assign this to myself and figure out how to document it. Probably won't 
be today.

------------------------------------------------------------------------
[2013-09-27 08:05:06] mike@php.net

Duh, unfortunately pretty much the opposite:

bool(true) -> int(1) & ~0xf == 0

The first bits are reserved for the OB handler type (internal/user) and thus ignored, so flags end
up as zero, which in turn means the handler is neither removeable, nor flushable, nor cleanable.

I suspect, I could have done better.

------------------------------------------------------------------------
[2013-09-26 21:23:31] aharvey@php.net

Mike, what happens if you pass true as the "flags" parameter in 5.4+? It looks 
easier to ask you than figure out the code paths, honestly, and we need to cover 
the BC story somehow.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=64977


--
Edit this bug report at https://bugs.php.net/bug.php?id=64977&edit=1


Thread (11 messages)

« previous php.doc.bugs (#11660) next »