diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 730a445577994..c1853c0340fe5 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -392,6 +392,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, zend_ulong num_index; ZEND_HASH_FOREACH_KEY_VAL(args, num_index, str_index, elem) { + ZVAL_DEREF(elem); Formattable& formattable = fargs[argNum]; UnicodeString& key = farg_names[argNum]; Formattable::Type argType = Formattable::kObject, //unknown diff --git a/ext/intl/tests/gh8364.phpt b/ext/intl/tests/gh8364.phpt new file mode 100644 index 0000000000000..74a0b5629ec9c --- /dev/null +++ b/ext/intl/tests/gh8364.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug GH-8364 (msgfmt_format $values may not support references) +--SKIPIF-- + +--FILE-- +format($args); +var_dump($result); +var_dump(intl_get_error_code()); +?> +--EXPECT-- +string(16) "translate string" +int(0)