File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ var_dump($data);
26
26
int(1)
27
27
array(2) {
28
28
[0]=>
29
- object(DateInterval)#1 (15 ) {
29
+ object(DateInterval)#1 (16 ) {
30
30
["y"]=>
31
31
int(-1)
32
32
["m"]=>
@@ -39,6 +39,8 @@ array(2) {
39
39
int(-1)
40
40
["s"]=>
41
41
int(-1)
42
+ ["f"]=>
43
+ float(-1)
42
44
["weekday"]=>
43
45
int(-1)
44
46
["weekday_behavior"]=>
Original file line number Diff line number Diff line change @@ -1118,7 +1118,6 @@ PHP_FUNCTION(unserialize)
1118
1118
}
1119
1119
RETVAL_FALSE ;
1120
1120
} else {
1121
- ZVAL_DEREF (retval );
1122
1121
ZVAL_COPY (return_value , retval );
1123
1122
}
1124
1123
@@ -1130,6 +1129,13 @@ PHP_FUNCTION(unserialize)
1130
1129
/* Reset to previous allowed_classes in case this is a nested call */
1131
1130
php_var_unserialize_set_allowed_classes (var_hash , prev_class_hash );
1132
1131
PHP_VAR_UNSERIALIZE_DESTROY (var_hash );
1132
+
1133
+ /* Per calling convention we must not return a reference here, so unwrap. We're doing this at
1134
+ * the very end, because __wakeup() calls performed during UNSERIALIZE_DESTROY might affect
1135
+ * the value we unwrap here. This is compatible with behavior in PHP <=7.0. */
1136
+ if (Z_ISREF_P (return_value )) {
1137
+ zend_unwrap_reference (return_value );
1138
+ }
1133
1139
}
1134
1140
/* }}} */
1135
1141
You can’t perform that action at this time.
0 commit comments