ob_get_level

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Return the nesting level of the output buffering mechanism
<?php ob_get_level(): int
<?php     protected function handleViewException(Throwable $baseException, $obLevel)

    {

        while (ob_get_level() > $obLevel) {

            ob_end_clean();

        }