Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Oct 18, 2024
2 parents 64f312f + b2b294a commit 8acdde5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ext/date/php_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,7 @@ static void add_common_properties(HashTable *myht, zend_object *zobj)

common = zend_std_get_properties(zobj);

ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_IND(common, name, prop) {
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(common, name, prop) {
if (zend_hash_add(myht, name, prop) != NULL) {
Z_TRY_ADDREF_P(prop);
}
Expand Down Expand Up @@ -2869,7 +2869,7 @@ static void restore_custom_datetime_properties(zval *object, HashTable *myht)
zend_string *prop_name;
zval *prop_val;

ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
ZEND_HASH_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
if (!prop_name || (Z_TYPE_P(prop_val) == IS_REFERENCE) || date_time_is_internal_property(prop_name)) {
continue;
}
Expand Down Expand Up @@ -3982,7 +3982,7 @@ static void restore_custom_datetimezone_properties(zval *object, HashTable *myht
zend_string *prop_name;
zval *prop_val;

ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
ZEND_HASH_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
if (!prop_name || (Z_TYPE_P(prop_val) == IS_REFERENCE) || date_timezone_is_internal_property(prop_name)) {
continue;
}
Expand Down Expand Up @@ -4619,7 +4619,7 @@ static void restore_custom_dateinterval_properties(zval *object, HashTable *myht
zend_string *prop_name;
zval *prop_val;

ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
ZEND_HASH_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
if (!prop_name || (Z_TYPE_P(prop_val) == IS_REFERENCE) || date_interval_is_internal_property(prop_name)) {
continue;
}
Expand Down Expand Up @@ -5692,7 +5692,7 @@ static void restore_custom_dateperiod_properties(zval *object, HashTable *myht)
zend_string *prop_name;
zval *prop_val;

ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
ZEND_HASH_FOREACH_STR_KEY_VAL(myht, prop_name, prop_val) {
if (!prop_name || (Z_TYPE_P(prop_val) == IS_REFERENCE) || date_period_is_internal_property(prop_name)) {
continue;
}
Expand Down
9 changes: 9 additions & 0 deletions ext/date/tests/bug-gh16037.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--TEST--
Test for bug GH-16037: Assertion failure in ext/date/php_date.c
--FILE--
<?php
$di = (new DateInterval('P1Y'))->__unserialize([[]]);
echo gettype($di);
?>
--EXPECT--
NULL

0 comments on commit 8acdde5

Please sign in to comment.