forked from php/php-src
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed bug #61388 (ReflectionObject:getProperties() issues invalid r…
…eads when get_properties returns a hash table with (inaccessible) dynamic numeric properties).
- Loading branch information
1 parent
a369972
commit 773bedb
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--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] => oo | ||
[class] => stdClass | ||
) | ||
|
||
) |