xref: /PHP-8.0/ext/spl/tests/bug75242.phpt (revision ec142f2c)
1--TEST--
2Bug #75242: RecursiveArrayIterator doesn't have constants from parent class
3--FILE--
4<?php
5
6class Foo extends ArrayIterator { }
7
8$r = new ReflectionClass(Foo::class);
9var_dump($r->getConstants());
10$r = new ReflectionClass(ArrayIterator::class);
11var_dump($r->getConstants());
12$r = new ReflectionClass(RecursiveArrayIterator::class);
13var_dump($r->getConstants());
14
15?>
16--EXPECT--
17array(2) {
18  ["STD_PROP_LIST"]=>
19  int(1)
20  ["ARRAY_AS_PROPS"]=>
21  int(2)
22}
23array(2) {
24  ["STD_PROP_LIST"]=>
25  int(1)
26  ["ARRAY_AS_PROPS"]=>
27  int(2)
28}
29array(3) {
30  ["STD_PROP_LIST"]=>
31  int(1)
32  ["ARRAY_AS_PROPS"]=>
33  int(2)
34  ["CHILD_ARRAYS_ONLY"]=>
35  int(4)
36}
37