public function output($options = array())
    {
        $cfgRestore = $this->config->setCfg($options);
        if (!$this->cfg['output']) {
            $this->config->setCfg($cfgRestore);
            return null;
        }
        /*
            I'd like to put this outputAs setting bit inside Output::onOutput
            but, adding a debug.output subscriber from within a debug.output subscriber = fail
        */
        $outputAs = $this->output->getCfg('outputAs');
        if (\is_string($outputAs)) {
            $this->output->setCfg('outputAs', $outputAs);
        }
        /*
            Publish debug.output on all descendant channels and then ourself
        */
        $channels = $this->getChannels(true);
        $channels[] = $this;
        $headers = array();
        foreach ($channels as $channel) {
            $event = $channel->eventManager->publish(
                'debug.output',
                $channel,
                array(
                    'headers' => array(),
                    'return' => '',
                    'isTarget' => $channel === $this,
                )
            );
            $headers = \array_merge($headers, $event['headers']);
        }
        if (!$this->getCfg('outputHeaders') || !$headers) {
            $this->data['headers'] = \array_merge($this->data['headers'], $event['headers']);
        } elseif (\headers_sent($file, $line)) {
            \trigger_error('PHPDebugConsole: headers already sent: '.$file.', line '.$line, E_USER_NOTICE);
        } else {
            foreach ($headers as $nameVal) {
                \header($nameVal[0].': '.$nameVal[1]);
            }
        }
        if (!$this->parentInstance) {
            $this->data['outputSent'] = true;
        }
        $this->config->setCfg($cfgRestore);
        return $event['return'];
    }