diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-17 17:31:47 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-17 17:31:47 +0100 |
commit | b074e3b52b4dbc961b1b7e8ff80f6c6237666bbf (patch) | |
tree | 2d44f083dabe25f124b97322f4ecc3315460b1ec /ext/intl/common/common_date.cpp | |
parent | de5b42219c65f2d939caaa5ec8e39ead813ced15 (diff) | |
parent | 553a0c52b12d414c83130d845968fac5841236bf (diff) | |
download | php-git-b074e3b52b4dbc961b1b7e8ff80f6c6237666bbf.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fix #80763: msgfmt_format() does not accept DateTime references
Diffstat (limited to 'ext/intl/common/common_date.cpp')
-rw-r--r-- | ext/intl/common/common_date.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index d4767dc63b..5c1134aae7 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -173,6 +173,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func) return ZEND_NAN; } +try_again: switch (Z_TYPE_P(z)) { case IS_STRING: type = is_numeric_string(Z_STRVAL_P(z), Z_STRLEN_P(z), &lv, &rv, 0); @@ -225,6 +226,9 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func) efree(message); } break; + case IS_REFERENCE: + z = Z_REFVAL_P(z); + goto try_again; default: spprintf(&message, 0, "%s: invalid PHP type for date", func); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, |