mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
a0502b89a6
RFC: https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts This converts key types as appropriate in object to array and array to object casts, as well as in get_object_vars().
39 lines
871 B
PHP
39 lines
871 B
PHP
--TEST--
|
|
ReflectionObject:getProperties() issues invalid reads when it get_properties returns a hash table with (inaccessible) dynamic numeric properties
|
|
--FILE--
|
|
<?php
|
|
$x = new ArrayObject();
|
|
$x[0] = 'test string 2';
|
|
$x['test'] = 'test string 3';
|
|
$reflObj = new ReflectionObject($x);
|
|
print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
|
|
|
|
$x = (object)array("a", "oo" => "b");
|
|
$reflObj = new ReflectionObject($x);
|
|
print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
|
|
--EXPECT--
|
|
Array
|
|
(
|
|
[0] => ReflectionProperty Object
|
|
(
|
|
[name] => test
|
|
[class] => ArrayObject
|
|
)
|
|
|
|
)
|
|
Array
|
|
(
|
|
[0] => ReflectionProperty Object
|
|
(
|
|
[name] => 0
|
|
[class] => stdClass
|
|
)
|
|
|
|
[1] => ReflectionProperty Object
|
|
(
|
|
[name] => oo
|
|
[class] => stdClass
|
|
)
|
|
|
|
)
|