statvfs \
std_syslog \
strcasecmp \
-strfmon \
strnlen \
strptime \
strtok_r \
F1("str_word_count", MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("str_split", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
-#ifdef HAVE_STRFMON
- F1("money_format", MAY_BE_FALSE | MAY_BE_STRING),
-#endif
FN("substr", MAY_BE_FALSE | MAY_BE_STRING),
FN("substr_replace", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
F1("quotemeta", MAY_BE_STRING),
PHP_FE(utf8_decode, arginfo_utf8_decode)
PHP_FE(strcoll, arginfo_strcoll)
-#ifdef HAVE_STRFMON
- PHP_DEP_FE(money_format, arginfo_money_format)
-#endif
-
PHP_FE(substr, arginfo_substr)
PHP_FE(substr_replace, arginfo_substr_replace)
PHP_FE(quotemeta, arginfo_quotemeta)
function str_word_count(string $str, int $format = 0, string $charlist = UNKNOWN): array|int {}
-#ifdef HAVE_STRFMON
-function money_format(string $format, float $value): string|false {}
-#endif
-
function str_split(string $str, int $split_length = 1): array {}
function strpbrk(string $haystack, string $char_list): string|false {}
ZEND_ARG_TYPE_INFO(0, charlist, IS_STRING, 0)
ZEND_END_ARG_INFO()
-#if defined(HAVE_STRFMON)
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_money_format, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
- ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0)
- ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0)
-ZEND_END_ARG_INFO()
-#endif
-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_split, 0, 1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, split_length, IS_LONG, 0)
PHP_FUNCTION(utf8_encode);
PHP_FUNCTION(utf8_decode);
PHP_FUNCTION(strcoll);
-#if HAVE_STRFMON
-PHP_FUNCTION(money_format);
-#endif
#if defined(ZTS)
PHP_MINIT_FUNCTION(localeconv);
/* }}} */
-#if HAVE_STRFMON
-/* {{{ proto string|false money_format(string format , float value)
- Convert monetary value(s) to string */
-PHP_FUNCTION(money_format)
-{
- size_t format_len = 0;
- char *format, *p, *e;
- double value;
- zend_bool check = 0;
- zend_string *str;
- ssize_t res_len;
-
- ZEND_PARSE_PARAMETERS_START(2, 2)
- Z_PARAM_STRING(format, format_len)
- Z_PARAM_DOUBLE(value)
- ZEND_PARSE_PARAMETERS_END();
-
- p = format;
- e = p + format_len;
- while ((p = memchr(p, '%', (e - p)))) {
- if (*(p + 1) == '%') {
- p += 2;
- } else if (!check) {
- check = 1;
- p++;
- } else {
- php_error_docref(NULL, E_WARNING, "Only a single %%i or %%n token can be used");
- RETURN_FALSE;
- }
- }
-
- str = zend_string_safe_alloc(format_len, 1, 1024, 0);
- if ((res_len = strfmon(ZSTR_VAL(str), ZSTR_LEN(str), format, value)) < 0) {
- zend_string_efree(str);
- RETURN_FALSE;
- }
-#ifdef _AIX
- /*
- On AIX strfmon seems to include the terminating \0 in the length returned by strfmon,
- despite the documentation indicating it is not included.
- */
- ZSTR_LEN(str) = strlen(ZSTR_VAL(str));
-#else
- ZSTR_LEN(str) = (size_t)res_len;
-#endif
- ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
-
- RETURN_NEW_STR(zend_string_truncate(str, ZSTR_LEN(str), 0));
-}
-/* }}} */
-#endif
-
/* {{{ proto array str_split(string str [, int split_length])
Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long. */
PHP_FUNCTION(str_split)
+++ /dev/null
---TEST--
-Test money_format() function : basic functionality using national currency symbols
---SKIPIF--
-<?php
- if (!function_exists('money_format')) {
- die("SKIP money_format - not supported\n");
- }
-?>
---FILE--
-<?php
-/* Prototype : string money_format ( string $format , float $number )
- * Description: Formats a number as a currency string
- * Source code: ext/standard/string.c
-*/
-
-// ===========================================================================================
-// = We do not test for exact return-values, as those might be different between OS-versions =
-// ===========================================================================================
-
-echo "*** Testing money_format() : basic functionality***\n";
-
-$value = 1234.5678;
-$negative_value = -1234.5678;
-
-// Format with 14 positions of width, 8 digits of
-// left precision, 2 of right precision using national
-// format for en_US
-echo "Format values with 14 positions, 8 digits to left, 2 to right using national format\n";
-echo gettype(money_format('%14#8.2n', $value))."\n";
-echo gettype(money_format('%14#8.2n', $negative_value))."\n";
-
-// Same again but use '(' for negative values
-echo "Format again but with ( for negative values\n";
-echo gettype(money_format('%(14#8.2n', $value))."\n";
-echo gettype(money_format('%(14#8.2n', $negative_value))."\n";
-
-// Same again but use a '0' for padding character
-echo "Format with 0 for padding character\n";
-echo gettype(money_format('%=014#8.2n', $value))."\n";
-echo gettype(money_format('%=014#8.2n', $negative_value))."\n";
-
-// Same again but use a '*' for padding character
-echo "Format again with * for padding character\n";
-echo gettype(money_format('%=*14#8.2n', $value))."\n";
-echo gettype(money_format('%=*14#8.2n', $negative_value))."\n";
-
-// Same again but disable grouping character
-echo "Format again but disable grouping character\n";
-echo gettype(money_format('%=*^14#8.2n', $value))."\n";
-echo gettype(money_format('%=*^14#8.2n', $negative_value))."\n";
-
-// Same again but suppress currency symbol
-echo "Format again suppress currency symbol\n";
-echo gettype(money_format('%=*!14#8.2n', $value))."\n";
-echo gettype(money_format('%=*!14#8.2n', $negative_value))."\n";
-
-?>
---EXPECTF--
-*** Testing money_format() : basic functionality***
-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
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-Format again but with ( for negative values
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-Format with 0 for padding character
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-Format again with * for padding character
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-Format again but disable grouping character
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-Format again suppress currency symbol
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
-
-Deprecated: Function money_format() is deprecated in %s on line %d
-string
+++ /dev/null
---TEST--
-Test money_format() function : error conditions
---SKIPIF--
-<?php
- if (!function_exists('money_format')) {
- die("SKIP money_format - not supported\n");
- }
-?>
---FILE--
-<?php
-/* Prototype : string money_format ( string $format , float $number )
- * Description: Formats a number as a currency string
- * Source code: ext/standard/string.c
-*/
-
-// ===========================================================================================
-// = We do not test for exact return-values, as those might be different between OS-versions =
-// ===========================================================================================
-
-$string = '%14#8.2n';
-$value = 1234.56;
-$extra_arg = 10;
-
-echo "*** Testing money_format() : error conditions ***\n";
-
-echo "\n-- Testing money_format() function with more than one token --\n";
-var_dump( money_format($string . $string, $value) );
-?>
---EXPECTF--
-*** Testing money_format() : error conditions ***
-
--- 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
-bool(false)
+++ /dev/null
---TEST--
-money_format test
---SKIPIF--
-<?php
- if (!function_exists('money_format')) {
- die("SKIP money_format - not supported\n");
- }
-
-if (setlocale(LC_MONETARY, 'en_US') === false) {
- die('skip en_US locale not available');
-}
-?>
---FILE--
-<?php
-setlocale(LC_MONETARY, 'en_US');
-var_dump( money_format("X%nY", 3.1415));
-?>
---EXPECTF--
-Deprecated: Function money_format() is deprecated in %s on line %d
-string(7) "X$3.14Y"