Find position of first occurrence of a string within another, ignoring case differences */
PHP_FUNCTION(grapheme_stripos)
{
- char *haystack, *needle, *haystack_dup, *needle_dup;
+ char *haystack, *needle;
size_t haystack_len, needle_len;
const char *found;
zend_long loffset = 0;
is_ascii = ( grapheme_ascii_check((unsigned char*)haystack, haystack_len) >= 0 );
if ( is_ascii ) {
+ char *haystack_dup, *needle_dup;
int32_t noffset = offset >= 0 ? offset : (int32_t)haystack_len + offset;
needle_dup = estrndup(needle, needle_len);
php_strtolower(needle_dup, needle_len);
UBreakIterator* bi = NULL;
UErrorCode status;
UStringSearch* src = NULL;
- UCollator *coll;
if(puchar_pos) {
*puchar_pos = -1;
STRPOS_CHECK_STATUS(status, "Error creating search object");
if(f_ignore_case) {
- coll = usearch_getCollator(src);
+ UCollator *coll = usearch_getCollator(src);
status = U_ZERO_ERROR;
ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_SECONDARY, &status);
STRPOS_CHECK_STATUS(status, "Error setting collation strength");
int ustring_len = 0;
UErrorCode status;
zend_string *u8str;
- UChar converted[MAXPATHLEN];
- int32_t converted_ret_len;
/* convert the string to UTF-16. */
status = U_ZERO_ERROR;
RETURN_FALSE;
} else {
UParseError parse_error;
+ UChar converted[MAXPATHLEN];
+ int32_t converted_ret_len;
status = U_ZERO_ERROR;
if (mode == INTL_IDN_TO_ASCII) {