Open Paso opened 11 years ago
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();
adding
while(ob_end_clean());
at the beginning of discardBuffer() fixes it...
This will avoid an error if you're not currently in a buffer:
while (ob_get_level() > 0) ob_end_clean();
Fixed in PR: #94
Cleaning output buffers (preferably in a loop as buffers can be nested) in ErrorHandler->discardBuffer() solves the problem.
The following code recreates the problem: