xref: /PHP-7.4/ext/reflection/tests/bug61388.phpt (revision a5fa51af)
1--TEST--
2ReflectionObject:getProperties() issues invalid reads when it get_properties returns a hash table with (inaccessible) dynamic numeric properties
3--FILE--
4<?php
5$x = new ArrayObject();
6$x[0] = 'test string 2';
7$x['test'] = 'test string 3';
8$reflObj = new ReflectionObject($x);
9print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
10
11$x = (object)array("a", "oo" => "b");
12$reflObj = new ReflectionObject($x);
13print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
14--EXPECT--
15Array
16(
17)
18Array
19(
20    [0] => ReflectionProperty Object
21        (
22            [name] => 0
23            [class] => stdClass
24        )
25
26    [1] => ReflectionProperty Object
27        (
28            [name] => oo
29            [class] => stdClass
30        )
31
32)
33