Skip to content

Commit 158ba54

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
2 parents 4b7a906 + 331da7e commit 158ba54

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ PHP NEWS
5353
. Fixed bug GH-16181 (phpdbg: exit in exception handler reports fatal error).
5454
(cmb)
5555

56+
- Reflection:
57+
. Fixed bug GH-16187 (Assertion failure in ext/reflection/php_reflection.c).
58+
(DanielEScherzer)
59+
5660
- SimpleXML:
5761
. Fixed bug GH-15837 (Segmentation fault in ext/simplexml/simplexml.c).
5862
(nielsdos)

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
476476

477477
count = 0;
478478
if (properties && zend_hash_num_elements(properties)) {
479-
ZEND_HASH_MAP_FOREACH_STR_KEY(properties, prop_name) {
479+
ZEND_HASH_FOREACH_STR_KEY(properties, prop_name) {
480480
if (prop_name && ZSTR_LEN(prop_name) && ZSTR_VAL(prop_name)[0]) { /* skip all private and protected properties */
481481
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
482482
count++;

ext/reflection/tests/gh16187.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
GH-16187 (ReflectionClass::__toString() with unpacked properties)
3+
--EXTENSIONS--
4+
simplexml
5+
--FILE--
6+
<?php
7+
$xml = '<form name="test"></form>';
8+
$simplexml = simplexml_load_string($xml);
9+
$reflector = new ReflectionObject($simplexml['name']);
10+
$reflector->__toString();
11+
?>
12+
DONE
13+
--EXPECT--
14+
DONE

0 commit comments

Comments
 (0)