if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
+ handle_strpos_error(n);
RETVAL_FALSE;
}
}
if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
+ handle_strpos_error(n);
RETVAL_FALSE;
}
}
break;
}
- if (offset != 0) {
- size_t haystack_char_len = mbfl_strlen(&haystack);
-
- if (mode) {
- if ((offset > 0 && (size_t)offset > haystack_char_len) ||
- (offset < 0 && (size_t)(-offset) > haystack_char_len)) {
- php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
- break;
- }
- } else {
- if (offset < 0) {
- offset += (zend_long)haystack_char_len;
- }
- if (offset < 0 || (size_t)offset > haystack_char_len) {
- php_error_docref(NULL, E_WARNING, "Offset not contained in string");
- break;
- }
- }
- }
-
n = mbfl_strpos(&haystack, &needle, offset, mode);
} while(0);
bool(false)
> Offset: 12
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
> Offset: -1
int(8)
int(4)
> Offset: -20
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
Warning: mb_stripos(): Offset not contained in string in %s on line %d
bool(false)
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
-- ASCII string with out of bound positive offset --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
-- ASCII string with out of bound negative offset --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
-- Multi-byte string without offset --
-- Multi-byte string with out of bound positive offset --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
-- Multi-byte string with out of bound negative offset --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
**-- Offset is: 30 --**
-- ASCII String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
--Multibyte String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
**-- Offset is: 40 --**
-- ASCII String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
--Multibyte String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
**-- Offset is: 50 --**
-- ASCII String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
--Multibyte String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
**-- Offset is: 60 --**
-- ASCII String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
--Multibyte String --
-Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
+Warning: mb_strripos(): Offset not contained in string in %s on line %d
bool(false)
Done