1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00

Deprecate encoding as 3rd param to mb_strrpos()

This commit is contained in:
Nikita Popov
2019-07-11 17:02:04 +02:00
parent 3121b7174f
commit 39e756e7fe
3 changed files with 18 additions and 2 deletions
+3
View File
@@ -2600,6 +2600,9 @@ PHP_FUNCTION(mb_strrpos)
break;
default :
enc_name = Z_STR_P(zoffset);
php_error_docref(NULL, E_DEPRECATED,
"Passing the encoding as third parameter is deprecated. "
"Use an explicit zero offset");
break;
}
} else {
@@ -9,5 +9,6 @@ mb_internal_encoding('UTF-16');
var_dump(mb_strrpos("abc abc abc", "abc", "UTF-8"));
?>
--EXPECT--
--EXPECTF--
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(8)
+13 -1
View File
@@ -38,24 +38,36 @@ foreach ($inputs as $type => $input) {
echo "Done";
?>
--EXPECT--
--EXPECTF--
*** Testing mb_strrpos() : usage variations ***
-- Double Quoted String --
-- With fourth encoding argument --
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(20)
-- Without fourth encoding argument --
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(20)
-- Single Quoted String --
-- With fourth encoding argument --
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(20)
-- Without fourth encoding argument --
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(20)
-- Heredoc --
-- With fourth encoding argument --
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(20)
-- Without fourth encoding argument --
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in %s on line %d
int(20)
Done