From: Nikita Popov Date: Thu, 11 Jul 2019 15:12:08 +0000 (+0200) Subject: Deprecate money_format() X-Git-Tag: php-7.4.0beta1~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1cdf06673789cf5c379e7af88c5af98bd06735c;p=php Deprecate money_format() --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 2e3ef19bb7..0e11c1c088 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2804,7 +2804,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(strcoll, arginfo_strcoll) #ifdef HAVE_STRFMON - PHP_FE(money_format, arginfo_money_format) + PHP_DEP_FE(money_format, arginfo_money_format) #endif PHP_FE(substr, arginfo_substr) diff --git a/ext/standard/tests/strings/money_format_basic1.phpt b/ext/standard/tests/strings/money_format_basic1.phpt index dc9b167ebf..a9e8f70818 100644 --- a/ext/standard/tests/strings/money_format_basic1.phpt +++ b/ext/standard/tests/strings/money_format_basic1.phpt @@ -56,24 +56,48 @@ echo gettype(money_format('%=*!14#8.2n', $negative_value))."\n"; ?> ===DONE=== ---EXPECT-- +--EXPECTF-- *** Testing money_format() : basic functionality*** Format values with 14 positions, 8 digits to left, 2 to right using national format + +Deprecated: Function money_format() is deprecated in %s on line %d string + +Deprecated: Function money_format() is deprecated in %s on line %d string Format again but with ( for negative values + +Deprecated: Function money_format() is deprecated in %s on line %d string + +Deprecated: Function money_format() is deprecated in %s on line %d string Format with 0 for padding character + +Deprecated: Function money_format() is deprecated in %s on line %d string + +Deprecated: Function money_format() is deprecated in %s on line %d string Format again with * for padding character + +Deprecated: Function money_format() is deprecated in %s on line %d string + +Deprecated: Function money_format() is deprecated in %s on line %d string Format again but disable grouping character + +Deprecated: Function money_format() is deprecated in %s on line %d string + +Deprecated: Function money_format() is deprecated in %s on line %d string Format again suppress currency symbol + +Deprecated: Function money_format() is deprecated in %s on line %d string + +Deprecated: Function money_format() is deprecated in %s on line %d string ===DONE=== diff --git a/ext/standard/tests/strings/money_format_error.phpt b/ext/standard/tests/strings/money_format_error.phpt index 454b593537..da725a4131 100644 --- a/ext/standard/tests/strings/money_format_error.phpt +++ b/ext/standard/tests/strings/money_format_error.phpt @@ -41,21 +41,29 @@ var_dump( money_format($string . $string, $value) ); -- Testing money_format() function with no arguments -- +Deprecated: Function money_format() is deprecated in %s on line %d + Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d NULL -- Testing money_format() function with insufficient arguments -- +Deprecated: Function money_format() is deprecated in %s on line %d + Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d NULL -- Testing money_format() function with more than expected no. of arguments -- +Deprecated: Function money_format() is deprecated in %s on line %d + Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d NULL -- Testing money_format() function with more than one token -- +Deprecated: Function money_format() is deprecated in %s on line %d + Warning: money_format(): Only a single %ci or %cn token can be used in %s on line %d bool(false) ===DONE=== diff --git a/ext/standard/tests/strings/moneyformat.phpt b/ext/standard/tests/strings/moneyformat.phpt index 0eec563a39..9c10148f7d 100644 --- a/ext/standard/tests/strings/moneyformat.phpt +++ b/ext/standard/tests/strings/moneyformat.phpt @@ -15,5 +15,6 @@ if (setlocale(LC_MONETARY, 'en_US') === false) { setlocale(LC_MONETARY, 'en_US'); var_dump( money_format("X%nY", 3.1415)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function money_format() is deprecated in %s on line %d string(7) "X$3.14Y"