Skip to content

Update mbstring parameter names #6207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions ext/mbstring/mbstring.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function mb_substitute_character(string|int|null $substitute_character = null):
function mb_preferred_mime_name(string $encoding): string|false {}

/** @param array $result */
function mb_parse_str(string $encoded_string, &$result): bool {}
function mb_parse_str(string $string, &$result): bool {}

function mb_output_handler(string $contents, int $status): string {}
function mb_output_handler(string $string, int $status): string {}

function mb_str_split(string $string, int $split_length = 1, ?string $encoding = null): array {}
function mb_str_split(string $string, int $length = 1, ?string $encoding = null): array {}

function mb_strlen(string $string, ?string $encoding = null): int {}

Expand All @@ -33,13 +33,13 @@ function mb_stripos(string $haystack, string $needle, int $offset = 0, ?string $

function mb_strripos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false {}

function mb_strstr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {}
function mb_strstr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {}

function mb_strrchr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {}
function mb_strrchr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {}

function mb_stristr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {}
function mb_stristr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {}

function mb_strrichr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {}
function mb_strrichr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {}

function mb_substr_count(string $haystack, string $needle, ?string $encoding = null): int {}

Expand All @@ -51,76 +51,76 @@ function mb_strwidth(string $string, ?string $encoding = null): int {}

function mb_strimwidth(string $string, int $start, int $width, string $trim_marker = "", ?string $encoding = null): string {}

function mb_convert_encoding(array|string $string, string $to, array|string|null $from = null): array|string|false {}
function mb_convert_encoding(array|string $string, string $to_encoding, array|string|null $from_encoding = null): array|string|false {}

function mb_convert_case(string $string, int $mode, ?string $encoding = null): string {}

function mb_strtoupper(string $string, ?string $encoding = null): string {}

function mb_strtolower(string $string, ?string $encoding = null): string {}

function mb_detect_encoding(string $string, array|string|null $encoding_list = null, bool $strict = false): string|false {}
function mb_detect_encoding(string $string, array|string|null $encodings = null, bool $strict = false): string|false {}

function mb_list_encodings(): array {}

function mb_encoding_aliases(string $encoding): array {}

function mb_encode_mimeheader(string $string, ?string $charset = null, ?string $transfer = null, string $linefeed = "\r\n", int $indent = 0): string {}
function mb_encode_mimeheader(string $string, ?string $charset = null, ?string $transfer_encoding = null, string $newline = "\r\n", int $indent = 0): string {}

function mb_decode_mimeheader(string $string): string {}

function mb_convert_kana(string $string, string $option = "KV", ?string $encoding = null): string {}
function mb_convert_kana(string $string, string $mode = "KV", ?string $encoding = null): string {}

function mb_convert_variables(string $to, array|string $from, mixed &$var, mixed &...$vars): string|false {}
function mb_convert_variables(string $to_encoding, array|string $from_encoding, mixed &$var, mixed &...$vars): string|false {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

$from / $to -> $decode / $encode

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the suggestion. Are you saying the parameter names should be $encode and $decode or $encode_encoding and $decode_encoding? Both don't really make sense to me.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion was to name them $encode and $decode. My idea was that $decode says how to decode the string while $encode says how to encode it again. It made me think of how it would be written in Python:

my_string.decode('iso-8859-1').encode('utf8')

The names are short too. To me it does make sense, but that could just be me. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to leave these at just $to and $from if the _encoding suffix makes them too long.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P.S. I like their current names ^^ But unfortunately I can only have a closer look a bit later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to mention a few other options: UConverter::__construct() uses $source_encoding and $destination_encoding ($target_encoding reads better for me though).


function mb_encode_numericentity(string $string, array $convmap, ?string $encoding = null, bool $is_hex = false): string {}
function mb_encode_numericentity(string $string, array $map, ?string $encoding = null, bool $hex = false): string {}

function mb_decode_numericentity(string $string, array $convmap, ?string $encoding = null): string {}
function mb_decode_numericentity(string $string, array $map, ?string $encoding = null): string {}

function mb_send_mail(string $to, string $subject, string $message, array|string $additional_headers = [], ?string $additional_parameters = null): bool {}
function mb_send_mail(string $to, string $subject, string $message, array|string $additional_headers = [], ?string $additional_params = null): bool {}

function mb_get_info(string $type = "all"): array|string|int|false {}

function mb_check_encoding(array|string|null $var = null, ?string $encoding = null): bool {}
function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool {}

function mb_scrub(string $string, ?string $encoding = null): string {}

function mb_ord(string $string, ?string $encoding = null): int|false {}

function mb_chr(int $cp, ?string $encoding = null): string|false {}
function mb_chr(int $codepoint, ?string $encoding = null): string|false {}

#ifdef HAVE_MBREGEX
function mb_regex_encoding(?string $encoding = null): string|bool {}

/** @param array $registers */
function mb_ereg(string $pattern, string $string, &$registers = null): int|false {}
/** @param array $matches */
function mb_ereg(string $pattern, string $string, &$matches = null): int|false {}

/** @param array $registers */
function mb_eregi(string $pattern, string $string, &$registers = null): int|false {}
/** @param array $matches */
function mb_eregi(string $pattern, string $string, &$matches = null): int|false {}

function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $option = null): string|false|null {}
function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The similarity with the pcre extension was already mentioned. In that context I would probably rename $option to $modifiers.

However that would also mean the documentation text needs updating. Which... would not be a bad idea anyways. It speaks about "options" and then lists all possible "options" which also include "modes". So options can also contain a mode. Confusing.

https://www.php.net/manual/en/function.mb-regex-set-options.php

Maybe it should speak about "behavior modifiers" and "syntax modifiers" in stead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, modifiers is a possible alternative term. However, the referenced function is called mb_regex_set_options(), so that seems like the preferred term for mb_regex. (PCRE also never exposes "modifiers" in parameters, as they are part of the regex -- as such, there is no naming consistency to upkeep in that respect at least.)


function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $option = null): string|false|null {}
function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {}

function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $option = null): string|false|null {}
function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = null): string|false|null {}

function mb_split(string $pattern, string $string, int $limit = -1): array|false {}

function mb_ereg_match(string $pattern, string $string, ?string $option = null): bool {}
function mb_ereg_match(string $pattern, string $string, ?string $options = null): bool {}

function mb_ereg_search(?string $pattern = null, ?string $option = null): bool {}
function mb_ereg_search(?string $pattern = null, ?string $options = null): bool {}

function mb_ereg_search_pos(?string $pattern = null, ?string $option = null): array|false {}
function mb_ereg_search_pos(?string $pattern = null, ?string $options = null): array|false {}

function mb_ereg_search_regs(?string $pattern = null, ?string $option = null): array|false {}
function mb_ereg_search_regs(?string $pattern = null, ?string $options = null): array|false {}

function mb_ereg_search_init(string $string, ?string $pattern = null, ?string $option = null): bool {}
function mb_ereg_search_init(string $string, ?string $pattern = null, ?string $options = null): bool {}

function mb_ereg_search_getregs(): array|false {}

function mb_ereg_search_getpos(): int {}

function mb_ereg_search_setpos(int $position): bool {}
function mb_ereg_search_setpos(int $offset): bool {}

function mb_regex_set_options(?string $options = null): string {}
#endif
54 changes: 27 additions & 27 deletions ext/mbstring/mbstring_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 85cabf678a06175d4da073be79a0951d4f3786ed */
* Stub hash: 3e5b45cf71fe75bde026062816cb28eceea4aa38 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_language, 0, 0, MAY_BE_STRING|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, language, IS_STRING, 1, "null")
Expand Down Expand Up @@ -28,18 +28,18 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_preferred_mime_name, 0, 1, MA
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_parse_str, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, encoded_string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_INFO(1, result)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_output_handler, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, contents, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, status, IS_LONG, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_str_split, 0, 1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, split_length, IS_LONG, 0, "1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

Expand All @@ -64,7 +64,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_strstr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, part, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, before_needle, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

Expand Down Expand Up @@ -101,8 +101,8 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_encoding, 0, 2, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_MASK(0, string, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO(0, to_encoding, IS_STRING, 0)
ZEND_ARG_TYPE_MASK(0, from_encoding, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_convert_case, 0, 2, IS_STRING, 0)
Expand All @@ -120,7 +120,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_detect_encoding, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_MASK(0, encoding_list, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_MASK(0, encodings, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()

Expand All @@ -134,8 +134,8 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_mimeheader, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, transfer, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, linefeed, IS_STRING, 0, "\"\\r\\n\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, transfer_encoding, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, newline, IS_STRING, 0, "\"\\r\\n\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, indent, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()

Expand All @@ -145,27 +145,27 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_convert_kana, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 0, "\"KV\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"KV\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_variables, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO(0, to_encoding, IS_STRING, 0)
ZEND_ARG_TYPE_MASK(0, from_encoding, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0)
ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_numericentity, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, convmap, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, map, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, is_hex, _IS_BOOL, 0, "false")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hex, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_decode_numericentity, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, convmap, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, map, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

Expand All @@ -174,15 +174,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_send_mail, 0, 3, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
ZEND_ARG_TYPE_MASK(0, additional_headers, MAY_BE_ARRAY|MAY_BE_STRING, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_parameters, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_params, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_get_info, 0, 0, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_STRING, 0, "\"all\"")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_check_encoding, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_MASK(0, var, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_MASK(0, value, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

Expand All @@ -194,7 +194,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ord, 0, 1, MAY_BE_LONG|MAY_BE
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_chr, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, cp, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, codepoint, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()

Expand All @@ -208,7 +208,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, registers, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, matches, "null")
ZEND_END_ARG_INFO()
#endif

Expand All @@ -221,7 +221,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace, 0, 3, MAY_BE_ST
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, replacement, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif

Expand All @@ -234,7 +234,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace_callback, 0, 3,
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif

Expand All @@ -250,21 +250,21 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_match, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif

#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif

#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_search_pos, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif

Expand All @@ -276,7 +276,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_init, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif

Expand All @@ -292,7 +292,7 @@ ZEND_END_ARG_INFO()

#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_setpos, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif

Expand Down
6 changes: 3 additions & 3 deletions ext/mbstring/tests/bug79149.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ try {

?>
--EXPECTF--
mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "0"
mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "0"

Warning: Array to string conversion in %s on line %d
mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "Array"
mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "foo"
mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "Array"
mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "foo"
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_convert_encoding.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg==
== INVALID PARAMETER ==
INT: 1234
EUC-JP:
mb_convert_encoding(): Argument #2 ($to) must be a valid encoding, "BAD" given
mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "BAD" given
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ try {

?>
--EXPECT--
mb_convert_encoding(): Argument #3 ($from) must specify at least one encoding
mb_convert_encoding(): Argument #3 ($from) must specify at least one encoding
mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding
mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ try {

?>
--EXPECT--
mb_convert_variables(): Argument #2 ($from) must specify at least one encoding
mb_convert_variables(): Argument #2 ($from) must specify at least one encoding
mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding
mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_decode_numericentity.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ aŒbœcŠdše€fg
&#0000000000
&#000000000
föo
mb_decode_numericentity(): Argument #2 ($convmap) must have a multiple of 4 elements
mb_decode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_detect_encoding.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ SJIS: SJIS
== INVALID PARAMETER ==
INT: EUC-JP
EUC-JP: EUC-JP
mb_detect_encoding(): Argument #2 ($encoding_list) contains invalid encoding "BAD"
mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "BAD"
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ try {

?>
--EXPECT--
mb_detect_encoding(): Argument #2 ($encoding_list) must specify at least one encoding
mb_detect_encoding(): Argument #2 ($encoding_list) must specify at least one encoding
mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding
mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding
Loading