Skip to content

Commit 70dc5d3

Browse files
committed
Remove money_format() function
1 parent 58ba13c commit 70dc5d3

File tree

9 files changed

+0
-231
lines changed

9 files changed

+0
-231
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ static const func_info_t func_infos[] = {
178178
F1("str_split", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
179179
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
180180
F0("substr_compare", MAY_BE_FALSE | MAY_BE_LONG),
181-
#ifdef HAVE_STRFMON
182-
F1("money_format", MAY_BE_FALSE | MAY_BE_STRING),
183-
#endif
184181
FN("substr", MAY_BE_FALSE | MAY_BE_STRING),
185182
FN("substr_replace", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
186183
F1("quotemeta", MAY_BE_STRING),

ext/standard/basic_functions.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,10 +932,6 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
932932
PHP_FE(utf8_decode, arginfo_utf8_decode)
933933
PHP_FE(strcoll, arginfo_strcoll)
934934

935-
#ifdef HAVE_STRFMON
936-
PHP_DEP_FE(money_format, arginfo_money_format)
937-
#endif
938-
939935
PHP_FE(substr, arginfo_substr)
940936
PHP_FE(substr_replace, arginfo_substr_replace)
941937
PHP_FE(quotemeta, arginfo_quotemeta)

ext/standard/basic_functions.stub.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,6 @@ function str_shuffle(string $str): string {}
669669

670670
function str_word_count(string $str, int $format = 0, string $charlist = UNKNOWN): array|int {}
671671

672-
#ifdef HAVE_STRFMON
673-
function money_format(string $format, float $value): string|false {}
674-
#endif
675-
676672
function str_split(string $str, int $split_length = 1): array {}
677673

678674
function strpbrk(string $haystack, string $char_list): string|false {}

ext/standard/basic_functions_arginfo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,13 +1052,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_str_word_count, 0, 1, MAY_BE_ARR
10521052
ZEND_ARG_TYPE_INFO(0, charlist, IS_STRING, 0)
10531053
ZEND_END_ARG_INFO()
10541054

1055-
#if defined(HAVE_STRFMON)
1056-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_money_format, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
1057-
ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0)
1058-
ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0)
1059-
ZEND_END_ARG_INFO()
1060-
#endif
1061-
10621055
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_split, 0, 1, IS_ARRAY, 0)
10631056
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
10641057
ZEND_ARG_TYPE_INFO(0, split_length, IS_LONG, 0)

ext/standard/php_string.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ PHP_FUNCTION(substr_compare);
8989
PHP_FUNCTION(utf8_encode);
9090
PHP_FUNCTION(utf8_decode);
9191
PHP_FUNCTION(strcoll);
92-
#if HAVE_STRFMON
93-
PHP_FUNCTION(money_format);
94-
#endif
9592

9693
#if defined(ZTS)
9794
PHP_MINIT_FUNCTION(localeconv);

ext/standard/string.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5946,58 +5946,6 @@ PHP_FUNCTION(str_word_count)
59465946

59475947
/* }}} */
59485948

5949-
#if HAVE_STRFMON
5950-
/* {{{ proto string|false money_format(string format , float value)
5951-
Convert monetary value(s) to string */
5952-
PHP_FUNCTION(money_format)
5953-
{
5954-
size_t format_len = 0;
5955-
char *format, *p, *e;
5956-
double value;
5957-
zend_bool check = 0;
5958-
zend_string *str;
5959-
ssize_t res_len;
5960-
5961-
ZEND_PARSE_PARAMETERS_START(2, 2)
5962-
Z_PARAM_STRING(format, format_len)
5963-
Z_PARAM_DOUBLE(value)
5964-
ZEND_PARSE_PARAMETERS_END();
5965-
5966-
p = format;
5967-
e = p + format_len;
5968-
while ((p = memchr(p, '%', (e - p)))) {
5969-
if (*(p + 1) == '%') {
5970-
p += 2;
5971-
} else if (!check) {
5972-
check = 1;
5973-
p++;
5974-
} else {
5975-
php_error_docref(NULL, E_WARNING, "Only a single %%i or %%n token can be used");
5976-
RETURN_FALSE;
5977-
}
5978-
}
5979-
5980-
str = zend_string_safe_alloc(format_len, 1, 1024, 0);
5981-
if ((res_len = strfmon(ZSTR_VAL(str), ZSTR_LEN(str), format, value)) < 0) {
5982-
zend_string_efree(str);
5983-
RETURN_FALSE;
5984-
}
5985-
#ifdef _AIX
5986-
/*
5987-
On AIX strfmon seems to include the terminating \0 in the length returned by strfmon,
5988-
despite the documentation indicating it is not included.
5989-
*/
5990-
ZSTR_LEN(str) = strlen(ZSTR_VAL(str));
5991-
#else
5992-
ZSTR_LEN(str) = (size_t)res_len;
5993-
#endif
5994-
ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
5995-
5996-
RETURN_NEW_STR(zend_string_truncate(str, ZSTR_LEN(str), 0));
5997-
}
5998-
/* }}} */
5999-
#endif
6000-
60015949
/* {{{ proto array str_split(string str [, int split_length])
60025950
Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long. */
60035951
PHP_FUNCTION(str_split)

ext/standard/tests/strings/money_format_basic1.phpt

Lines changed: 0 additions & 101 deletions
This file was deleted.

ext/standard/tests/strings/money_format_error.phpt

Lines changed: 0 additions & 37 deletions
This file was deleted.

ext/standard/tests/strings/moneyformat.phpt

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)