Skip to content

Commit 144b41c

Browse files
committed
Remove money_format() function
1 parent 64468d1 commit 144b41c

File tree

10 files changed

+0
-232
lines changed

10 files changed

+0
-232
lines changed

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ statfs \
607607
statvfs \
608608
std_syslog \
609609
strcasecmp \
610-
strfmon \
611610
strnlen \
612611
strptime \
613612
strtok_r \

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ static const func_info_t func_infos[] = {
164164
F1("str_word_count", MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
165165
F1("str_split", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
166166
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
167-
#ifdef HAVE_STRFMON
168-
F1("money_format", MAY_BE_FALSE | MAY_BE_STRING),
169-
#endif
170167
FN("substr", MAY_BE_FALSE | MAY_BE_STRING),
171168
FN("substr_replace", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
172169
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
@@ -667,10 +667,6 @@ function str_shuffle(string $str): string {}
667667

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

670-
#ifdef HAVE_STRFMON
671-
function money_format(string $format, float $value): string|false {}
672-
#endif
673-
674670
function str_split(string $str, int $split_length = 1): array {}
675671

676672
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
@@ -5925,58 +5925,6 @@ PHP_FUNCTION(str_word_count)
59255925

59265926
/* }}} */
59275927

5928-
#if HAVE_STRFMON
5929-
/* {{{ proto string|false money_format(string format , float value)
5930-
Convert monetary value(s) to string */
5931-
PHP_FUNCTION(money_format)
5932-
{
5933-
size_t format_len = 0;
5934-
char *format, *p, *e;
5935-
double value;
5936-
zend_bool check = 0;
5937-
zend_string *str;
5938-
ssize_t res_len;
5939-
5940-
ZEND_PARSE_PARAMETERS_START(2, 2)
5941-
Z_PARAM_STRING(format, format_len)
5942-
Z_PARAM_DOUBLE(value)
5943-
ZEND_PARSE_PARAMETERS_END();
5944-
5945-
p = format;
5946-
e = p + format_len;
5947-
while ((p = memchr(p, '%', (e - p)))) {
5948-
if (*(p + 1) == '%') {
5949-
p += 2;
5950-
} else if (!check) {
5951-
check = 1;
5952-
p++;
5953-
} else {
5954-
php_error_docref(NULL, E_WARNING, "Only a single %%i or %%n token can be used");
5955-
RETURN_FALSE;
5956-
}
5957-
}
5958-
5959-
str = zend_string_safe_alloc(format_len, 1, 1024, 0);
5960-
if ((res_len = strfmon(ZSTR_VAL(str), ZSTR_LEN(str), format, value)) < 0) {
5961-
zend_string_efree(str);
5962-
RETURN_FALSE;
5963-
}
5964-
#ifdef _AIX
5965-
/*
5966-
On AIX strfmon seems to include the terminating \0 in the length returned by strfmon,
5967-
despite the documentation indicating it is not included.
5968-
*/
5969-
ZSTR_LEN(str) = strlen(ZSTR_VAL(str));
5970-
#else
5971-
ZSTR_LEN(str) = (size_t)res_len;
5972-
#endif
5973-
ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
5974-
5975-
RETURN_NEW_STR(zend_string_truncate(str, ZSTR_LEN(str), 0));
5976-
}
5977-
/* }}} */
5978-
#endif
5979-
59805928
/* {{{ proto array str_split(string str [, int split_length])
59815929
Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long. */
59825930
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)