Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ PHP NEWS
. Fixed bug GH-16181 (phpdbg: exit in exception handler reports fatal error).
(cmb)

- Reflection:
. Fixed bug GH-16187 (Assertion failure in ext/reflection/php_reflection.c).
(DanielEScherzer)

- SimpleXML:
. Fixed bug GH-15837 (Segmentation fault in ext/simplexml/simplexml.c).
(nielsdos)
Expand Down
2 changes: 1 addition & 1 deletion ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char

count = 0;
if (properties && zend_hash_num_elements(properties)) {
ZEND_HASH_MAP_FOREACH_STR_KEY(properties, prop_name) {
ZEND_HASH_FOREACH_STR_KEY(properties, prop_name) {
if (prop_name && ZSTR_LEN(prop_name) && ZSTR_VAL(prop_name)[0]) { /* skip all private and protected properties */
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
count++;
Expand Down
14 changes: 14 additions & 0 deletions ext/reflection/tests/gh16187.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
GH-16187 (ReflectionClass::__toString() with unpacked properties)
--EXTENSIONS--
simplexml
--FILE--
<?php
$xml = '<form name="test"></form>';
$simplexml = simplexml_load_string($xml);
$reflector = new ReflectionObject($simplexml['name']);
$reflector->__toString();
?>
DONE
--EXPECT--
DONE
Loading