Skip to content

Commit b1cdf06

Browse files
committed
Deprecate money_format()
1 parent 4e4d8a4 commit b1cdf06

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

ext/standard/basic_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2804,7 +2804,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
28042804
PHP_FE(strcoll, arginfo_strcoll)
28052805

28062806
#ifdef HAVE_STRFMON
2807-
PHP_FE(money_format, arginfo_money_format)
2807+
PHP_DEP_FE(money_format, arginfo_money_format)
28082808
#endif
28092809

28102810
PHP_FE(substr, arginfo_substr)

ext/standard/tests/strings/money_format_basic1.phpt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,48 @@ echo gettype(money_format('%=*!14#8.2n', $negative_value))."\n";
5656

5757
?>
5858
===DONE===
59-
--EXPECT--
59+
--EXPECTF--
6060
*** Testing money_format() : basic functionality***
6161
Format values with 14 positions, 8 digits to left, 2 to right using national format
62+
63+
Deprecated: Function money_format() is deprecated in %s on line %d
6264
string
65+
66+
Deprecated: Function money_format() is deprecated in %s on line %d
6367
string
6468
Format again but with ( for negative values
69+
70+
Deprecated: Function money_format() is deprecated in %s on line %d
6571
string
72+
73+
Deprecated: Function money_format() is deprecated in %s on line %d
6674
string
6775
Format with 0 for padding character
76+
77+
Deprecated: Function money_format() is deprecated in %s on line %d
6878
string
79+
80+
Deprecated: Function money_format() is deprecated in %s on line %d
6981
string
7082
Format again with * for padding character
83+
84+
Deprecated: Function money_format() is deprecated in %s on line %d
7185
string
86+
87+
Deprecated: Function money_format() is deprecated in %s on line %d
7288
string
7389
Format again but disable grouping character
90+
91+
Deprecated: Function money_format() is deprecated in %s on line %d
7492
string
93+
94+
Deprecated: Function money_format() is deprecated in %s on line %d
7595
string
7696
Format again suppress currency symbol
97+
98+
Deprecated: Function money_format() is deprecated in %s on line %d
7799
string
100+
101+
Deprecated: Function money_format() is deprecated in %s on line %d
78102
string
79103
===DONE===

ext/standard/tests/strings/money_format_error.phpt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,29 @@ var_dump( money_format($string . $string, $value) );
4141

4242
-- Testing money_format() function with no arguments --
4343

44+
Deprecated: Function money_format() is deprecated in %s on line %d
45+
4446
Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d
4547
NULL
4648

4749
-- Testing money_format() function with insufficient arguments --
4850

51+
Deprecated: Function money_format() is deprecated in %s on line %d
52+
4953
Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d
5054
NULL
5155

5256
-- Testing money_format() function with more than expected no. of arguments --
5357

58+
Deprecated: Function money_format() is deprecated in %s on line %d
59+
5460
Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d
5561
NULL
5662

5763
-- Testing money_format() function with more than one token --
5864

65+
Deprecated: Function money_format() is deprecated in %s on line %d
66+
5967
Warning: money_format(): Only a single %ci or %cn token can be used in %s on line %d
6068
bool(false)
6169
===DONE===

ext/standard/tests/strings/moneyformat.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ if (setlocale(LC_MONETARY, 'en_US') === false) {
1515
setlocale(LC_MONETARY, 'en_US');
1616
var_dump( money_format("X%nY", 3.1415));
1717
?>
18-
--EXPECT--
18+
--EXPECTF--
19+
Deprecated: Function money_format() is deprecated in %s on line %d
1920
string(7) "X$3.14Y"

0 commit comments

Comments
 (0)