MyArrayObject example

new \DatePeriod($start$interval, 4),
        ]];

        $value = new ArrayObject();
        $value[0] = 1;
        $value->foo = new \ArrayObject();
        $value[1] = $value;

        yield ['array-object', $value];

        yield ['array-iterator', new \ArrayIterator([123], 1)];
        yield ['array-object-custom', new MyArrayObject([234])];

        $errorHandler = set_error_handler(static function Dint $errno, string $errstr) use (&$errorHandler) {
            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;
        });

        
Home | Imprint | This part of the site doesn't use cookies.