mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
Deprecate money_format()
This commit is contained in:
parent
4e4d8a4a6c
commit
b1cdf06673
4 changed files with 36 additions and 3 deletions
|
@ -2804,7 +2804,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
|
||||||
PHP_FE(strcoll, arginfo_strcoll)
|
PHP_FE(strcoll, arginfo_strcoll)
|
||||||
|
|
||||||
#ifdef HAVE_STRFMON
|
#ifdef HAVE_STRFMON
|
||||||
PHP_FE(money_format, arginfo_money_format)
|
PHP_DEP_FE(money_format, arginfo_money_format)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PHP_FE(substr, arginfo_substr)
|
PHP_FE(substr, arginfo_substr)
|
||||||
|
|
|
@ -56,24 +56,48 @@ echo gettype(money_format('%=*!14#8.2n', $negative_value))."\n";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
===DONE===
|
===DONE===
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
*** Testing money_format() : basic functionality***
|
*** Testing money_format() : basic functionality***
|
||||||
Format values with 14 positions, 8 digits to left, 2 to right using national format
|
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
|
string
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
Format again but with ( for negative values
|
Format again but with ( for negative values
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
Format with 0 for padding character
|
Format with 0 for padding character
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
Format again with * for padding character
|
Format again with * for padding character
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
Format again but disable grouping character
|
Format again but disable grouping character
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
Format again suppress currency symbol
|
Format again suppress currency symbol
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
|
|
||||||
|
Deprecated: Function money_format() is deprecated in %s on line %d
|
||||||
string
|
string
|
||||||
===DONE===
|
===DONE===
|
||||||
|
|
|
@ -41,21 +41,29 @@ var_dump( money_format($string . $string, $value) );
|
||||||
|
|
||||||
-- Testing money_format() function with no arguments --
|
-- 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
|
Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d
|
||||||
NULL
|
NULL
|
||||||
|
|
||||||
-- Testing money_format() function with insufficient arguments --
|
-- 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
|
Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d
|
||||||
NULL
|
NULL
|
||||||
|
|
||||||
-- Testing money_format() function with more than expected no. of arguments --
|
-- 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
|
Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d
|
||||||
NULL
|
NULL
|
||||||
|
|
||||||
-- Testing money_format() function with more than one token --
|
-- 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
|
Warning: money_format(): Only a single %ci or %cn token can be used in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
===DONE===
|
===DONE===
|
||||||
|
|
|
@ -15,5 +15,6 @@ if (setlocale(LC_MONETARY, 'en_US') === false) {
|
||||||
setlocale(LC_MONETARY, 'en_US');
|
setlocale(LC_MONETARY, 'en_US');
|
||||||
var_dump( money_format("X%nY", 3.1415));
|
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"
|
string(7) "X$3.14Y"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue