diff --git a/src/Listener/Mvc.php b/src/Listener/Mvc.php index a159433d..37c923f2 100644 --- a/src/Listener/Mvc.php +++ b/src/Listener/Mvc.php @@ -66,6 +66,10 @@ public function phpError(MvcEvent $e) : void \ini_set('display_errors', '0'); } + while (\ob_get_level() > 0) { + \ob_end_flush(); + } + \ob_start([$this, 'phpFatalErrorHandler']); \register_shutdown_function([$this, 'execOnShutdown']); \set_error_handler([$this, 'phpErrorHandler']); diff --git a/src/Middleware/Expressive.php b/src/Middleware/Expressive.php index fef6d6ae..dca15e46 100644 --- a/src/Middleware/Expressive.php +++ b/src/Middleware/Expressive.php @@ -69,6 +69,10 @@ public function phpError() : void \ini_set('display_errors', '0'); } + while (\ob_get_level() > 0) { + \ob_end_flush(); + } + \ob_start([$this, 'phpFatalErrorHandler']); \register_shutdown_function([$this, 'execOnShutdown']); \set_error_handler([$this, 'phpErrorHandler']);