MySerializable example

if (\E_DEPRECATED === $errno && str_contains($errstr, 'implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead')) {
                // We're testing if the component handles deprecated Serializable implementations well.                 // This kind of implementation triggers a deprecation warning since PHP 8.1 that we explicitly want to                 // ignore here. We probably need to reevaluate this piece of code for PHP 9.                 return true;
            }

            return $errorHandler ? $errorHandler(...\func_get_args()) : false;
        });

        try {
            $mySerializable = new MySerializable();
            $fooSerializable = new FooSerializable('bar');
        } finally {
            restore_error_handler();
        }

        yield ['serializable', [$mySerializable$mySerializable]];
        yield ['foo-serializable', $fooSerializable];

        unset($mySerializable$fooSerializable$errorHandler);

        $value = new MyWakeup();
        
Home | Imprint | This part of the site doesn't use cookies.