xref: /PHP-8.3/ext/spl/tests/bug62672.phpt (revision 7aacc705)
1--TEST--
2Bug #62672 (Error on serialize of ArrayObject)
3--FILE--
4<?php
5
6class ObjA
7{
8    private $_varA;
9
10    public function __construct(Iterator $source)
11    {
12        $this->_varA = $source;
13    }
14}
15
16class ObjB extends ObjA
17{
18    private $_varB;
19
20    public function __construct(ArrayObject $keys)
21    {
22        $this->_varB = $keys;
23        parent::__construct($keys->getIterator());
24    }
25}
26
27$obj = new ObjB(new ArrayObject());
28
29var_dump($obj == unserialize(serialize($obj)));
30?>
31--EXPECT--
32bool(true)
33