1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Avoid unnecessary string refcounting in ext/date (#17890)

This commit is contained in:
Niels Dossche
2025-03-02 22:55:06 +01:00
committed by GitHub
parent d95b9d6d32
commit 1ae2c871d0

View File

@@ -4682,9 +4682,10 @@ static void php_date_interval_initialize_from_hash(zval **return_value, php_inte
if (z_arg && Z_TYPE_P(z_arg) == IS_FALSE) { \
(*intobj)->diff->member = TIMELIB_UNSET; \
} else if (z_arg && Z_TYPE_P(z_arg) <= IS_STRING) { \
zend_string *str = zval_get_string(z_arg); \
zend_string *tmp_str; \
zend_string *str = zval_get_tmp_string(z_arg, &tmp_str); \
DATE_A64I((*intobj)->diff->member, ZSTR_VAL(str)); \
zend_string_release(str); \
zend_tmp_string_release(tmp_str); \
} else { \
(*intobj)->diff->member = -1LL; \
} \