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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user