Skip to content

Commit d517a7e

Browse files
committed
Remove money_format() function
1 parent 1113aab commit d517a7e

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
@@ -634,7 +634,6 @@ statfs \
634634
statvfs \
635635
std_syslog \
636636
strcasecmp \
637-
strfmon \
638637
strnlen \
639638
strptime \
640639
strtok_r \

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
@@ -5930,58 +5930,6 @@ PHP_FUNCTION(str_word_count)
59305930

59315931
/* }}} */
59325932

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