Skip to content

Commit 67eb210

Browse files
committed
Handle indirect zvals in SplFixedArray::__serialize
1 parent a082696 commit 67eb210

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/spl/spl_fixedarray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ PHP_METHOD(SplFixedArray, __serialize)
610610

611611
/* members */
612612
if (intern->std.properties) {
613-
ZEND_HASH_FOREACH_STR_KEY_VAL(intern->std.properties, key, current) {
613+
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(intern->std.properties, key, current) {
614614
/* The properties hash table can also contain the array elements if the properties table was already rebuilt.
615615
* In this case we'd have a NULL key. We can't simply use the properties table in all cases because it's
616616
* potentially out of sync (missing elements, or containing removed elements) and might need a rebuild. */

ext/spl/tests/gh10907.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ object(SplFixedArray)#1 (3) {
112112
}
113113
=================
114114
Test with adding members
115-
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";}"
115+
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";}"
116116
object(MySplFixedArray)#1 (5) {
117117
["my_string"]=>
118-
int(0)
118+
string(15) "my_string_value"
119119
["my_dynamic_property"]=>
120120
string(25) "my_dynamic_property_value"
121121
[0]=>

0 commit comments

Comments
 (0)