xref: /PHP-7.2/ext/reflection/tests/bug61388.phpt (revision a0502b89)
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    [0] => ReflectionProperty Object
18        (
19            [name] => test
20            [class] => ArrayObject
21        )
22
23)
24Array
25(
26    [0] => ReflectionProperty Object
27        (
28            [name] => 0
29            [class] => stdClass
30        )
31
32    [1] => ReflectionProperty Object
33        (
34            [name] => oo
35            [class] => stdClass
36        )
37
38)
39