xref: /php-src/ext/spl/tests/gh15833_1.phpt (revision b666dc97)
1--TEST--
2GH-15833 (Segmentation fault (access null pointer) in ext/spl/spl_array.c)
3--CREDITS--
4YuanchengJiang
5--FILE--
6<?php
7class C {
8    public int $a = 1;
9}
10$reflector = new ReflectionClass(C::class);
11$obj = $reflector->newLazyProxy(function ($obj) {
12    $obj = new C();
13    return $obj;
14});
15$recursiveArrayIterator = new RecursiveArrayIterator($obj);
16var_dump($recursiveArrayIterator->current());
17$recursiveArrayIterator->next();
18var_dump($recursiveArrayIterator->current());
19?>
20--EXPECT--
21int(1)
22NULL
23