restore_error_handler

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Restores the previous error handler function
<?php restore_error_handler(): true
<?php         while (true) {

            $previousHandler = set_error_handler(static fn () => null);



            restore_error_handler();



            if ($previousHandler === null) {

                break;
<?php                 break;

            }



            restore_error_handler();

        }



        if (class_exists(ErrorHandler::class)) {
<?php         try {

            return unserialize($value);

        } finally {

            restore_error_handler();

        }

    }
<?php         try {

            return unserialize($value);

        } finally {

            restore_error_handler();

        }

    }
<?php             throw $e;

        } finally {

            restore_error_handler();

        }

    }
<?php                 $errorMessage .= Preg::replace('{^fopen\(.*?\): }', '', $msg);

            });

            $bodyHandle = fopen($copyTo.'~', 'w+b');

            restore_error_handler();

            if (!$bodyHandle) {

                throw new TransportException('The "'.$url.'" file could not be written to '.$copyTo.': '.$errorMessage);

            }
<?php         if ($errorMessage && !filter_var(ini_get('allow_url_fopen'), FILTER_VALIDATE_BOOLEAN)) {

            $errorMessage = 'allow_url_fopen must be enabled in php.ini ('.$errorMessage.')';

        }

        restore_error_handler();

        if (isset($e) && !$this->retry) {

            if (!$this->degradedMode && false !== strpos($e->getMessage(), 'Operation timed out')) {

                $this->degradedMode = true;
<?php                 return true;

            });

            $result = (bool) file_put_contents($fileName, $result);

            restore_error_handler();

            if (false === $result) {

                throw new TransportException('The "'.$this->fileUrl.'" file could not be written to '.$fileName.': '.$errorMessage);

            }
<?php         set_error_handler(__CLASS__.'::handleError');

        try {

            $result = $func(...\array_slice(\func_get_args(), 1));

            restore_error_handler();



            return $result;

        } catch (\Throwable $e) {
<?php             return $result;

        } catch (\Throwable $e) {

        }

        restore_error_handler();



        throw $e;

    }
<?php     protected function tearDown(): void

    {

        parent::tearDown();

        restore_error_handler();

    }
<?php         $result = \stream_socket_enable_crypto($socket, $toggle, $method);



        \restore_error_handler();



        if (true === $result) {

            $deferred->resolve();
<?php         $errors = $this->errors;

        $this->errors = [];



        restore_error_handler();



        return $errors;

    }
<?php             if ($gc) {

                gc_enable();

            }

            restore_error_handler();

            $this->prevErrorHandler = null;

        }

    }
<?php                 return true;

            }

        } finally {

            restore_error_handler();

        }



        return false;