src/AbstractSapiEmitter.php
/**
     * Assert either that no headers been sent or the output buffer contains no content.
     *
     * @throws \RuntimeException
     *
     * @return void
     */
Assert either that no headers been sent or the output buffer contains no content.

@return void
Assert either that no headers been sent or the output buffer contains no content . @return void
protected function assertNoPreviousOutput(): void
    {
        $file = $line = null;
        if (headers_sent($file, $line)) {
            throw new RuntimeException(\sprintf(
                'Unable to emit response: Headers already sent in file %s on line %s. ' .
                'This happens if echo, print, printf, print_r, var_dump, var_export or similar statement that writes to the output buffer are used.',
                $file,
                $line
            ));
        }
        if (\ob_get_level() > 0 && \ob_get_length() > 0) {
            throw new RuntimeException('Output has been emitted previously; cannot emit response.');
        }
    }
protected function assertNoPreviousOutput ( ) : void { $ file = $ line = null ; if ( headers_sent ( $ file , $ line ) ) { throw new RuntimeException ( \ sprintf ( 'Unable to emit response: Headers already sent in file %s on line %s. ' . 'This happens if echo, print, printf, print_r, var_dump, var_export or similar statement that writes to the output buffer are used.' , $ file , $ line ) ) ; } if ( \ ob_get_level ( ) > 0 && \ ob_get_length ( ) > 0 ) { throw new RuntimeException ( 'Output has been emitted previously; cannot emit response.' ) ; } }
Assert either that no headers been sent or the output buffer contains no content.
Assert either that no headers been sent or the output buffer contains no content .