Skip to content

White page when application using output buffers triggers notice/warning. #34

@Paso

Description

@Paso

Cleaning output buffers (preferably in a loop as buffers can be nested) in ErrorHandler->discardBuffer() solves the problem.

The following code recreates the problem:

<?php

ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
error_reporting(-1);
require_once('../library/php_error.php');
\php_error\reportErrors();

ob_start();

echo "before";
trigger_error("ERROR", E_USER_NOTICE);
echo "after";

ob_flush();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions