Skip to content

Commit 6631aa9

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 612a6ad + 158ba54 commit 6631aa9

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ PHP NEWS
7474
- Reflection:
7575
. Fixed bug GH-16122 (The return value of ReflectionFunction::getNamespaceName()
7676
and ReflectionFunction::inNamespace() for closures is incorrect). (timwolla)
77+
. Fixed bug GH-16187 (Assertion failure in ext/reflection/php_reflection.c).
78+
(DanielEScherzer)
7779

7880
- SAPI:
7981
. Fixed bug GHSA-9pqp-7h25-4f32 (Erroneous parsing of multipart form data).

ext/reflection/php_reflection.c

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

485485
count = 0;
486486
if (properties && zend_hash_num_elements(properties)) {
487-
ZEND_HASH_MAP_FOREACH_STR_KEY(properties, prop_name) {
487+
ZEND_HASH_FOREACH_STR_KEY(properties, prop_name) {
488488
if (prop_name && ZSTR_LEN(prop_name) && ZSTR_VAL(prop_name)[0]) { /* skip all private and protected properties */
489489
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
490490
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)