Skip to content

Commit

Permalink
Merge branch 'PHP-8.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Oct 18, 2024
2 parents a920afd + 9923e14 commit b63167f
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 @@ -2308,7 +2308,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 @@ -2965,7 +2965,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 @@ -4166,7 +4166,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 @@ -4801,7 +4801,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 @@ -5878,7 +5878,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 b63167f

Please sign in to comment.