Skip to content

Commit 42ecd88

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Revert "Handle indirect zvals in SplFixedArray::__serialize"
2 parents abcb88e + 0d524ed commit 42ecd88

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

ext/spl/spl_fixedarray.c

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

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

ext/spl/tests/SplFixedArray_get_properties_for.phpt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@ array(3) {
7171
}
7272
}
7373
[{},{}]
74-
O:15:"MySplFixedArray":4:{i:0;O:8:"stdClass":0:{}i:1;O:1:"Y":0:{}s:1:"x";O:13:"SplFixedArray":0:{}s:1:"0";O:1:"X":0:{}}
75-
object(MySplFixedArray)#6 (3) {
74+
O:15:"MySplFixedArray":5:{i:0;O:8:"stdClass":0:{}i:1;O:1:"Y":0:{}s:1:"x";i:0;s:1:"y";i:0;s:1:"0";O:1:"X":0:{}}
75+
object(MySplFixedArray)#6 (4) {
7676
[0]=>
77-
object(X)#10 (0) {
77+
object(X)#9 (0) {
7878
}
7979
[1]=>
8080
object(Y)#8 (0) {
8181
}
8282
["x"]=>
83-
object(SplFixedArray)#9 (0) {
84-
}
83+
int(0)
84+
["y"]=>
85+
int(0)
8586
}

ext/spl/tests/gh10907.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ object(SplFixedArray)#1 (3) {
112112
}
113113
=================
114114
Test with adding members
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";}"
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";}"
116116
object(MySplFixedArray)#1 (5) {
117117
[0]=>
118118
string(12) "test value 1"
@@ -121,7 +121,7 @@ object(MySplFixedArray)#1 (5) {
121121
[2]=>
122122
NULL
123123
["my_string"]=>
124-
string(15) "my_string_value"
124+
int(0)
125125
["my_dynamic_property"]=>
126126
string(25) "my_dynamic_property_value"
127127
}

0 commit comments

Comments
 (0)