return;
}
- haystack.no_language = needle.no_language = MBSTRG(language);
- haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
- if (!haystack.encoding) {
- RETURN_FALSE;
- }
-
if (zoffset) {
if (Z_TYPE_P(zoffset) == IS_STRING) {
enc_name2 = Z_STRVAL_P(zoffset);
}
}
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
+ }
+
if (offset != 0) {
size_t haystack_char_len = mbfl_strlen(&haystack);
if ((offset > 0 && offset > haystack_char_len) ||
--- /dev/null
+--TEST--
+Passing encoding as 3rd param to mb_strrpos (legacy)
+--FILE--
+<?php
+
+mb_internal_encoding('UTF-16');
+var_dump(mb_strrpos("abc abc abc", "abc", "UTF-8"));
+
+?>
+--EXPECT--
+int(8)