diff --git a/ext/intl/formatter/formatter.stub.php b/ext/intl/formatter/formatter.stub.php index da6a6e3c5a6..84ae31b5183 100644 --- a/ext/intl/formatter/formatter.stub.php +++ b/ext/intl/formatter/formatter.stub.php @@ -392,6 +392,7 @@ class NumberFormatter public const TYPE_DOUBLE = UNKNOWN; /** * @var int + * @deprecated * @cvalue FORMAT_TYPE_CURRENCY */ public const TYPE_CURRENCY = UNKNOWN; diff --git a/ext/intl/formatter/formatter_arginfo.h b/ext/intl/formatter/formatter_arginfo.h index 3488b025c72..27851b18051 100644 --- a/ext/intl/formatter/formatter_arginfo.h +++ b/ext/intl/formatter/formatter_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: de64db0e66d2113dd10c556cd61324a7a7952973 */ + * Stub hash: 3b050eaf6f2f54e3726b04a17d40b06ad610a724 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) @@ -571,7 +571,7 @@ static zend_class_entry *register_class_NumberFormatter(void) zval const_TYPE_CURRENCY_value; ZVAL_LONG(&const_TYPE_CURRENCY_value, FORMAT_TYPE_CURRENCY); zend_string *const_TYPE_CURRENCY_name = zend_string_init_interned("TYPE_CURRENCY", sizeof("TYPE_CURRENCY") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_TYPE_CURRENCY_name, &const_TYPE_CURRENCY_value, ZEND_ACC_PUBLIC, NULL); + zend_declare_class_constant_ex(class_entry, const_TYPE_CURRENCY_name, &const_TYPE_CURRENCY_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); zend_string_release(const_TYPE_CURRENCY_name); return class_entry; diff --git a/ext/intl/tests/deprecated_number_formater_type_currency.phpt b/ext/intl/tests/deprecated_number_formater_type_currency.phpt new file mode 100644 index 00000000000..bbc53cc2910 --- /dev/null +++ b/ext/intl/tests/deprecated_number_formater_type_currency.phpt @@ -0,0 +1,15 @@ +--TEST-- +NumberFormatter::TYPE_CURRENCY is deprecated +--EXTENSIONS-- +intl +--FILE-- + +--EXPECTF-- +Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d +int(4) + +Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d +int(4) diff --git a/ext/intl/tests/formatter_format_and_parse_errors.phpt b/ext/intl/tests/formatter_format_and_parse_errors.phpt index 5d46cafa36b..e58455c5e4e 100644 --- a/ext/intl/tests/formatter_format_and_parse_errors.phpt +++ b/ext/intl/tests/formatter_format_and_parse_errors.phpt @@ -54,12 +54,20 @@ try { } ?> ---EXPECT-- +--EXPECTF-- numfmt_format(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant NumberFormatter::format(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant numfmt_parse(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant NumberFormatter::parse(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant + +Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d numfmt_format(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_format_currency() function instead + +Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d NumberFormatter::format(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::formatCurrency() method instead + +Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d numfmt_parse(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_parse_currency() function instead + +Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d NumberFormatter::parse(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::parseCurrency() method instead