PHP: Flags Passed To Output Handlers - Manual (original) (raw)

Change language:

The bitmask passed to the second phase parameter of the output handler provides information on the invocation of the handler.

Note: The bitmask can include more than one flag and the bitwise & operator should be used to check whether a flag is set.

Warning

The value of [PHP_OUTPUT_HANDLER_WRITE](outcontrol.constants.php#constant.php-output-handler-write) and its alias**[PHP_OUTPUT_HANDLER_CONT](outcontrol.constants.php#constant.php-output-handler-cont)** is 0 therefore whether it is set can only be determined by using anequality operator (== or ===).

The following flags are set in a specific phase of the handler's lifecycle:[PHP_OUTPUT_HANDLER_START](outcontrol.constants.php#constant.php-output-handler-start) is set when a handler is invoked for the first time.[PHP_OUTPUT_HANDLER_FINAL](outcontrol.constants.php#constant.php-output-handler-final) or its alias [PHP_OUTPUT_HANDLER_END](outcontrol.constants.php#constant.php-output-handler-end) is set when a handler is invoked for the last time, i.e. it is being turned off. This flag is also set when buffers are being turned off by PHP's shutdown process.

The following flags are set by a specific invocation of the handler:[PHP_OUTPUT_HANDLER_FLUSH](outcontrol.constants.php#constant.php-output-handler-flush) is set when the handler is invoked by calling ob_flush().[PHP_OUTPUT_HANDLER_WRITE](outcontrol.constants.php#constant.php-output-handler-write) or its alias [PHP_OUTPUT_HANDLER_CONT](outcontrol.constants.php#constant.php-output-handler-cont) is set when the size of its contents equals or exceeds the size of the buffer and the handler is invoked while the buffer is being automatically flushed.[PHP_OUTPUT_HANDLER_FLUSH](outcontrol.constants.php#constant.php-output-handler-flush) is set when the handler is invoked by calling ob_clean(),ob_end_clean() or ob_get_clean(). When ob_end_clean() or ob_get_clean() is called, [PHP_OUTPUT_HANDLER_FINAL](outcontrol.constants.php#constant.php-output-handler-final) is set as well.

Note: When ob_end_flush() or ob_get_flush() is called, [PHP_OUTPUT_HANDLER_FINAL](outcontrol.constants.php#constant.php-output-handler-final) is set but [PHP_OUTPUT_HANDLER_FLUSH](outcontrol.constants.php#constant.php-output-handler-flush) is not.

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug

+add a note

User Contributed Notes

There are no user contributed notes for this page.