set_error_handler

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Sets a user-defined error handler function
<?php set_error_handler(?callable $callback, int $error_levels = E_ALL): ?callable
<?php         $value = is_resource($value) ? stream_get_contents($value) : $value;



        set_error_handler(function (int $code, string $message): bool {

            throw ConversionException::conversionFailedUnserialization($this->getName(), $message);

        });



        try {

            return unserialize($value);
<?php         $value = is_resource($value) ? stream_get_contents($value) : $value;



        set_error_handler(function (int $code, string $message): bool {

            throw ConversionException::conversionFailedUnserialization($this->getName(), $message);

        });



        try {

            return unserialize($value);