diff --git a/NEWS b/NEWS index 4c8f00d13a1..8d8bb73e016 100644 --- a/NEWS +++ b/NEWS @@ -66,6 +66,8 @@ PHP NEWS PHP 8.2.4). (nielsdos) . Fixed bug GH-10844 (ArrayIterator allows modification of readonly props). (ilutov) + . Fixed bug GH-10925 (Handle indirect zvals in SplFixedArray::__serialize). + (nielsdos) - Standard: . Fixed bug GH-10885 (stream_socket_server context leaks). (ilutov) diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index bf9ec4e695f..4f7138cdc75 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -610,7 +610,7 @@ PHP_METHOD(SplFixedArray, __serialize) /* members */ if (intern->std.properties) { - ZEND_HASH_FOREACH_STR_KEY_VAL(intern->std.properties, key, current) { + ZEND_HASH_FOREACH_STR_KEY_VAL_IND(intern->std.properties, key, current) { /* The properties hash table can also contain the array elements if the properties table was already rebuilt. * In this case we'd have a NULL key. We can't simply use the properties table in all cases because it's * potentially out of sync (missing elements, or containing removed elements) and might need a rebuild. */ diff --git a/ext/spl/tests/gh10907.phpt b/ext/spl/tests/gh10907.phpt index 034c5f1d5a3..49d98ae5ef3 100644 --- a/ext/spl/tests/gh10907.phpt +++ b/ext/spl/tests/gh10907.phpt @@ -112,10 +112,10 @@ object(SplFixedArray)#1 (3) { } ================= Test with adding members -string(161) "O:15:"MySplFixedArray":5:{i:0;s:12:"test value 1";i:1;s:12:"test value 2";i:2;N;s:9:"my_string";i:0;s:19:"my_dynamic_property";s:25:"my_dynamic_property_value";}" +string(180) "O:15:"MySplFixedArray":5:{i:0;s:12:"test value 1";i:1;s:12:"test value 2";i:2;N;s:9:"my_string";s:15:"my_string_value";s:19:"my_dynamic_property";s:25:"my_dynamic_property_value";}" object(MySplFixedArray)#1 (5) { ["my_string"]=> - int(0) + string(15) "my_string_value" ["my_dynamic_property"]=> string(25) "my_dynamic_property_value" [0]=>