/** * Callback for output handling. * * @param string|array $buffer * @param int $flags * @return string|array */ public function callback($buffer, $flags) { $marker = $this->opt & Output::IGNORE_MARKERS || is_array($buffer) ? null : Output::curMarker(); // Directly flush the output if (!isset($marker)) { return $this->transform->process($buffer); } // Keep caching the output of flush $this->data[$marker] = $this->data; return $flags & PHP_OUTPUT_HANDLER_END ? $this->transform->process($this->data) : null; }