]> granicus.if.org Git - php/commitdiff
cleanup string parameter parsing, fix some tests
authorStanislav Malyshev <stas@php.net>
Sat, 15 Aug 2009 05:43:18 +0000 (05:43 +0000)
committerStanislav Malyshev <stas@php.net>
Sat, 15 Aug 2009 05:43:18 +0000 (05:43 +0000)
33 files changed:
ext/standard/string.c
ext/standard/tests/strings/str_replace.phpt
ext/standard/tests/strings/stripos.phpt
ext/standard/tests/strings/stripos_variation1.phpt
ext/standard/tests/strings/stripos_variation10.phpt
ext/standard/tests/strings/stripos_variation11.phpt
ext/standard/tests/strings/stripos_variation15.phpt
ext/standard/tests/strings/stripos_variation2.phpt
ext/standard/tests/strings/stripos_variation3.phpt
ext/standard/tests/strings/stripos_variation9.phpt
ext/standard/tests/strings/stristr.phpt
ext/standard/tests/strings/stristr_variation1.phpt
ext/standard/tests/strings/stristr_variation2.phpt
ext/standard/tests/strings/strncmp_variation6.phpt
ext/standard/tests/strings/strrchr_variation10.phpt
ext/standard/tests/strings/strrchr_variation11.phpt
ext/standard/tests/strings/strrchr_variation12.phpt
ext/standard/tests/strings/strrchr_variation9.phpt
ext/standard/tests/strings/strripos_variation1.phpt
ext/standard/tests/strings/strripos_variation2.phpt
ext/standard/tests/strings/strripos_variation3.phpt
ext/standard/tests/strings/strrpos_error.phpt
ext/standard/tests/strings/strrpos_variation1.phpt
ext/standard/tests/strings/strrpos_variation10.phpt
ext/standard/tests/strings/strrpos_variation11.phpt
ext/standard/tests/strings/strrpos_variation14.phpt
ext/standard/tests/strings/strrpos_variation15.phpt
ext/standard/tests/strings/strrpos_variation2.phpt
ext/standard/tests/strings/strrpos_variation3.phpt
ext/standard/tests/strings/strrpos_variation7.phpt
ext/standard/tests/strings/strrpos_variation9.phpt
ext/standard/tests/strings/strstr.phpt
ext/standard/tests/strings/substr_count_error.phpt

index 2fd273aee2b7db9e07b0992c6dc006a7259ebfac..69a2b310ba5734b5e99fe9a1672e9a0d10111250 100644 (file)
@@ -2320,92 +2320,128 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
 }
 /* }}} */
 
-/* {{{ proto string stristr(string haystack, string needle[, bool part]) U
-   Finds first occurrence of a string within another, case insensitive */
-PHP_FUNCTION(stristr)
-{
-       zval **haystack, **needle;
-       zend_bool part = 0;
-       zend_uchar str_type;
-       char needle_char[2];
-       UChar u_needle_char[3];
-       int needle_len;
-       char *haystack_copy = NULL;
-       zstr target;
-       void *found = NULL;
-       int found_offset;
-       void *start, *end;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|b", &haystack, &needle, &part) == FAILURE) {
-               return;
+/* {{{ php_needle_char
+ */
+static long php_needle_char(zval *needle)
+{
+       switch (Z_TYPE_P(needle)) {
+               case IS_LONG:
+               case IS_BOOL:
+               case IS_RESOURCE:
+                       return Z_LVAL_P(needle);
+               case IS_DOUBLE:
+                       return (long)Z_DVAL_P(needle);
+               case IS_NULL:
+                       return 0;
+               case IS_OBJECT:
+                       {
+                               zval holder = *needle;
+                               zval_copy_ctor(&(holder));
+                               convert_to_long(&(holder));
+                               if(Z_TYPE(holder) != IS_LONG) {
+                                       return -1;
+                               }
+                               return (char)Z_LVAL(holder);
+                       }
+               default: {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer");
+                       return -1;
+                }
        }
+}
+/* }}} */
 
-       SEPARATE_ZVAL(haystack);
-       SEPARATE_ZVAL(needle);
-
-       if (Z_TYPE_PP(haystack) != IS_UNICODE && Z_TYPE_PP(haystack) != IS_STRING) {
-               convert_to_unicode_ex(haystack);
-       }
+static zstr php_needle_to_type(zval **needle, zend_uchar haystack_type, int *target_len, char *char_buf, UChar *uchar_buf)
+{
+       zstr target;
 
+       target.v = NULL;
        if (Z_TYPE_PP(needle) == IS_UNICODE || Z_TYPE_PP(needle) == IS_STRING) {
                if (!Z_UNILEN_PP(needle)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
-                       RETURN_FALSE;
+                       return target;
                }
-               if (Z_TYPE_PP(haystack) != Z_TYPE_PP(needle)) {
-                       str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(haystack), Z_TYPE_PP(needle));
-                       convert_to_explicit_type_ex(haystack, str_type);
-                       convert_to_explicit_type_ex(needle, str_type);
+               if (haystack_type != Z_TYPE_PP(needle)) {
+                       convert_to_explicit_type_ex(needle, haystack_type);
                }
                target = Z_UNIVAL_PP(needle);
-               needle_len = Z_UNILEN_PP(needle);
+               *target_len = Z_UNILEN_PP(needle);
        } else {
-               convert_to_long_ex(needle);
-               needle_len = 0;
-               if (Z_TYPE_PP(haystack) == IS_UNICODE) {
-                       if (Z_LVAL_PP(needle) < 0 || Z_LVAL_PP(needle) > 0x10FFFF) {
+               long needleval = php_needle_char(*needle);
+               if(needleval == -1) {
+                       return target;
+               }
+               *target_len = 0;
+               if (haystack_type == IS_UNICODE) {
+                       if (needleval < 0 || needleval > 0x10FFFF) {
                                php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
-                               RETURN_FALSE;
+                               return target;
                        }
-                       needle_len = zend_codepoint_to_uchar((UChar32)Z_LVAL_PP(needle), u_needle_char);
-                       u_needle_char[needle_len] = 0;
-                       target.u = u_needle_char;
+                       *target_len = zend_codepoint_to_uchar((UChar)needleval, uchar_buf);
+                       uchar_buf[*target_len] = 0;
+                       target.u = uchar_buf;
                } else {
-                       needle_char[needle_len++] = (char)Z_LVAL_PP(needle);
-                       needle_char[needle_len] = 0;
-                       target.s = needle_char;
+                       char_buf[(*target_len)++] = (char)needleval;
+                       char_buf[*target_len] = 0;
+                       target.s = char_buf;
                }
        }
+       return target;
+}
+
+/* {{{ proto string stristr(string haystack, string needle[, bool part]) U
+   Finds first occurrence of a string within another, case insensitive */
+PHP_FUNCTION(stristr)
+{
+       zstr haystack, target;
+       int haystack_len, needle_len = 0;
+       zend_uchar haystack_type;
+       zval **needle;
+       char needle_char[2];
+       UChar u_needle_char[3];
+       void *found = NULL;
+       zend_bool part = 0;
+       char *haystack_copy = NULL;
+       int found_offset;
+       void *start, *end;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|b", &haystack, &haystack_len, &haystack_type, &needle, &part) == FAILURE) {
+               return;
+       }
+
+       target = php_needle_to_type(needle, haystack_type, &needle_len, needle_char, u_needle_char);
+
+       if(target.v == NULL) {
+               RETURN_FALSE;
+       }
 
-       if (needle_len > Z_UNILEN_PP(haystack)) {
+       if (needle_len > haystack_len) {
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_PP(haystack) == IS_UNICODE) {
-               found = php_u_stristr(Z_USTRVAL_PP(haystack), target.u,
-                                                         Z_USTRLEN_PP(haystack), needle_len, 1 TSRMLS_CC);
+       if (haystack_type == IS_UNICODE) {
+               found = php_u_stristr(haystack.u, target.u, haystack_len, needle_len, 1 TSRMLS_CC);
        } else {
-               haystack_copy = estrndup(Z_STRVAL_PP(haystack), Z_STRLEN_PP(haystack));
-               found = php_stristr(Z_STRVAL_PP(haystack), target.s,
-                                                       Z_STRLEN_PP(haystack), needle_len);
+               haystack_copy = estrndup(haystack.s, haystack_len);
+               found = php_stristr(haystack.s, target.s, haystack_len, needle_len);
        }
 
        if (found) {
-               if (Z_TYPE_PP(haystack) == IS_UNICODE) {
-                       start = part ? Z_USTRVAL_PP(haystack) : found;
-                       end = part ? found : (Z_USTRVAL_PP(haystack) + Z_USTRLEN_PP(haystack));
+               if (haystack_type == IS_UNICODE) {
+                       start = part ? haystack.u : found;
+                       end = part ? found : (haystack.u + haystack_len);
                        RETVAL_UNICODEL((UChar *)start, (UChar *)end-(UChar *)start, 1);
                } else {
-                       found_offset = (char *)found - Z_STRVAL_PP(haystack);
+                       found_offset = (char *)found - haystack.s;
                        start = part ? haystack_copy : haystack_copy + found_offset;
-                       end = part ? haystack_copy + found_offset : (haystack_copy + Z_STRLEN_PP(haystack));
+                       end = part ? haystack_copy + found_offset : (haystack_copy + haystack_len);
                        RETVAL_STRINGL((char *)start, (char *)end-(char *)start, 1);
                }
        } else {
                RETVAL_FALSE;
        }
 
-       if (Z_TYPE_PP(haystack) != IS_UNICODE) {
+       if (haystack_type != IS_UNICODE) {
                efree(haystack_copy);
        }
 }
@@ -2415,14 +2451,13 @@ PHP_FUNCTION(stristr)
    Finds first occurrence of a string within another */
 PHP_FUNCTION(strstr)
 {
-       zstr haystack;
-       int haystack_len;
+       zstr haystack, target;
+       int haystack_len, needle_len = 0;
        zend_uchar haystack_type;
        zval **needle;
-       void *found = NULL;
-       char  needle_char[2];
+       char needle_char[2];
        UChar u_needle_char[3];
-       int n_len = 0;
+       void *found = NULL;
        size_t found_offset;
        zend_bool part = 0;
 
@@ -2430,50 +2465,20 @@ PHP_FUNCTION(strstr)
                return;
        }
 
-       if (Z_TYPE_PP(needle) == IS_STRING || Z_TYPE_PP(needle) == IS_UNICODE) {
-               if (!Z_STRLEN_PP(needle)) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
-                       RETURN_FALSE;
-               }
-
-               /* haystack type determines the needle type */
-               if (haystack_type == IS_UNICODE) {
-                       convert_to_unicode_ex(needle);
-                       found = zend_u_memnstr(haystack.u,
-                                                                  Z_USTRVAL_PP(needle),
-                                                                  Z_USTRLEN_PP(needle),
-                                                                  haystack.u + haystack_len);
-               } else {
-                       convert_to_string_ex(needle);
-                       found = php_memnstr(haystack.s,
-                                                               Z_STRVAL_PP(needle),
-                                                               Z_STRLEN_PP(needle),
-                                                               haystack.s + haystack_len);
-               }
-       } else {
-               convert_to_long_ex(needle);
-               if (haystack_type == IS_UNICODE) {
-                       if (Z_LVAL_PP(needle) < 0 || Z_LVAL_PP(needle) > 0x10FFFF) {
-                               php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
-                               RETURN_FALSE;
-                       }
+       target = php_needle_to_type(needle, haystack_type, &needle_len, needle_char, u_needle_char);
 
-                       n_len = zend_codepoint_to_uchar((UChar32)Z_LVAL_PP(needle), u_needle_char);
-                       u_needle_char[n_len] = 0;
+       if(target.v == NULL) {
+               RETURN_FALSE;
+       }
 
-                       found = zend_u_memnstr(haystack.u,
-                                                                  u_needle_char,
-                                                                  n_len,
-                                                                  haystack.u + haystack_len);
-               } else {
-                       needle_char[0] = (char) Z_LVAL_PP(needle);
-                       needle_char[1] = 0;
+       if (needle_len > haystack_len) {
+               RETURN_FALSE;
+       }
 
-                       found = php_memnstr(haystack.s,
-                                                               needle_char,
-                                                               1,
-                                                               haystack.s + haystack_len);
-               }
+       if (haystack_type == IS_UNICODE) {
+               found = zend_u_memnstr(haystack.u, target.u, needle_len, haystack.u + haystack_len);
+       } else {
+               found = php_memnstr(haystack.s, target.s, needle_len, haystack.s + haystack_len);
        }
 
        if (found) {
@@ -2518,15 +2523,14 @@ PHP_FUNCTION(strstr)
    Finds position of first occurrence of a string within another */
 PHP_FUNCTION(strpos)
 {
-       zstr haystack;
-       int haystack_len;
+       zstr haystack, target;
+       int haystack_len, needle_len = 0;
        zend_uchar haystack_type;
        zval **needle;
-       long   offset = 0;
-       void *found = NULL;
-       char  needle_char[2];
+       char needle_char[2];
        UChar u_needle_char[3];
-       int n_len = 0;
+       void *found = NULL;
+       long   offset = 0;
        int32_t cu_offset = 0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|l", &haystack,
@@ -2544,53 +2548,22 @@ PHP_FUNCTION(strpos)
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_PP(needle) == IS_STRING || Z_TYPE_PP(needle) == IS_UNICODE) {
-               if (!Z_STRLEN_PP(needle)) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
-                       RETURN_FALSE;
-               }
+       target = php_needle_to_type(needle, haystack_type, &needle_len, needle_char, u_needle_char);
 
-               /* haystack type determines the needle type */
-               if (haystack_type == IS_UNICODE) {
-                       convert_to_unicode_ex(needle);
-                       /* calculate code unit offset */
-                       U16_FWD_N(haystack.u, cu_offset, haystack_len, offset);
-                       found = zend_u_memnstr(haystack.u + cu_offset,
-                                                                  Z_USTRVAL_PP(needle),
-                                                                  Z_USTRLEN_PP(needle),
-                                                                  haystack.u + haystack_len);
-               } else {
-                       convert_to_string_ex(needle);
-                       found = php_memnstr(haystack.s + offset,
-                                                               Z_STRVAL_PP(needle),
-                                                               Z_STRLEN_PP(needle),
-                                                               haystack.s + haystack_len);
-               }
-       } else {
-               convert_to_long_ex(needle);
-               if (haystack_type == IS_UNICODE) {
-                       if (Z_LVAL_PP(needle) < 0 || Z_LVAL_PP(needle) > 0x10FFFF) {
-                               php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
-                               RETURN_FALSE;
-                       }
-                       n_len += zend_codepoint_to_uchar(Z_LVAL_PP(needle), u_needle_char);
-                       u_needle_char[n_len] = 0;
+       if(target.v == NULL) {
+               RETURN_FALSE;
+       }
 
-                       /* calculate code unit offset */
-                       U16_FWD_N(haystack.u, cu_offset, haystack_len, offset);
-                       found = zend_u_memnstr(haystack.u + cu_offset,
-                                                                  u_needle_char,
-                                                                  n_len,
-                                                                  haystack.u + haystack_len);
-               } else {
-                       needle_char[0] = (char) Z_LVAL_PP(needle);
-                       needle_char[1] = 0;
+       if (needle_len > haystack_len) {
+               RETURN_FALSE;
+       }
 
-                       found = php_memnstr(haystack.s + offset,
-                                                               needle_char,
-                                                               1,
-                                                               haystack.s + haystack_len);
-               }
+       if (haystack_type == IS_UNICODE) {
+               /* calculate code unit offset */
+               U16_FWD_N(haystack.u, cu_offset, haystack_len, offset);
+               found = zend_u_memnstr(haystack.u + cu_offset, target.u, needle_len, haystack.u + haystack_len);
+       } else {
+               found = php_memnstr(haystack.s + offset, target.s, needle_len, haystack.s + haystack_len);
        }
 
        if (found) {
@@ -2614,108 +2587,71 @@ PHP_FUNCTION(strpos)
    Finds position of first occurrence of a string within another, case insensitive */
 PHP_FUNCTION(stripos)
 {
-       zval **haystack, **needle;
-       long offset = 0;
+       zstr haystack, target;
        int haystack_len, needle_len = 0;
-       zend_uchar str_type;
-       void *haystack_dup = NULL, *needle_dup = NULL;
+       zend_uchar haystack_type;
+       zval **needle;
        char needle_char[2];
-       char c = 0;
        UChar u_needle_char[3];
        void *found = NULL;
+       long offset = 0;
+       char *haystack_dup = NULL, *needle_dup = NULL;
+       char c = 0;
        int cu_offset = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|l", &haystack, &needle, &offset) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|l", &haystack, &haystack_len, &haystack_type, &needle, &offset) == FAILURE) {
                return;
        }
 
-       if (Z_TYPE_PP(haystack) != IS_UNICODE && Z_TYPE_PP(haystack) != IS_STRING) {
-               convert_to_unicode_ex(haystack);
-       }
-
        /*
         * Unicode note: it's okay to not convert offset to code unit offset here.
         * We'll just do a rough check that the offset does not exceed length in
         * code units, and leave the rest to zend_u_memnstr().
         */
-       if (offset < 0 || offset > Z_UNILEN_PP(haystack)) {
+       if (offset < 0 || offset > haystack_len) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
                RETURN_FALSE;
        }
 
-       haystack_len = Z_UNILEN_PP(haystack);
-
        if (haystack_len == 0) {
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_PP(needle) == IS_UNICODE || Z_TYPE_PP(needle) == IS_STRING) {
-               if (!Z_UNILEN_PP(needle) || Z_UNILEN_PP(needle) > haystack_len) {
-                       RETURN_FALSE;
-               }
-               /* convert both strings to the same type */
-               if (Z_TYPE_PP(haystack) != Z_TYPE_PP(needle)) {
-                       str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(haystack), Z_TYPE_PP(needle));
-                       convert_to_explicit_type_ex(haystack, str_type);
-                       convert_to_explicit_type_ex(needle, str_type);
-               }
-               needle_len = Z_UNILEN_PP(needle);
-               if (Z_TYPE_PP(haystack) == IS_UNICODE) {
-                       /* calculate code unit offset */
-                       U16_FWD_N(Z_USTRVAL_PP(haystack), cu_offset, haystack_len, offset);
-                       found = php_u_stristr(Z_USTRVAL_PP(haystack) + cu_offset, Z_USTRVAL_PP(needle), haystack_len - cu_offset, needle_len, 1 TSRMLS_CC);
-               } else {
-                       haystack_dup = estrndup(Z_STRVAL_PP(haystack), haystack_len);
-                       php_strtolower((char *)haystack_dup, haystack_len);
-                       needle_dup = estrndup(Z_STRVAL_PP(needle), needle_len);
-                       php_strtolower((char *)needle_dup, Z_STRLEN_PP(needle));
-                       found = php_memnstr((char *)haystack_dup + offset,
-                                                               (char *)needle_dup, needle_len,
-                                                               (char *)haystack_dup + haystack_len);
-               }
-       } else {
-               convert_to_long_ex(needle);
-               if (Z_TYPE_PP(haystack) == IS_UNICODE) {
-                       if (Z_LVAL_PP(needle) < 0 || Z_LVAL_PP(needle) > 0x10FFFF) {
-                               php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
-                               RETURN_FALSE;      
-                       }
-                       needle_len = zend_codepoint_to_uchar((UChar32)Z_LVAL_PP(needle), u_needle_char);
-                       u_needle_char[needle_len] = 0;
-                       /* calculate code unit offset */
-                       U16_FWD_N(Z_USTRVAL_PP(haystack), cu_offset, haystack_len, offset);
-                       found = php_u_stristr(Z_USTRVAL_PP(haystack) + cu_offset,
-                                                                 u_needle_char, haystack_len - cu_offset, needle_len, 1 TSRMLS_CC);
-               } else {
-                       c = tolower((char)Z_LVAL_PP(needle));
-                       needle_char[0] = c;
-                       needle_char[1] = '\0';
-                       haystack_dup = estrndup(Z_STRVAL_PP(haystack), haystack_len);
-                       php_strtolower((char *)haystack_dup, haystack_len);
-                       found = php_memnstr((char *)haystack_dup + offset,
-                                                               (char *)needle_char,
-                                                               sizeof(needle_char) - 1,
-                                                               (char *)haystack_dup + haystack_len);
-               }
+       target = php_needle_to_type(needle, haystack_type, &needle_len, needle_char, u_needle_char);
+
+       if(target.v == NULL) {
+               RETURN_FALSE;
        }
 
-       if (haystack_dup) {
-               efree(haystack_dup);
+       if (needle_len > haystack_len) {
+               RETURN_FALSE;
        }
-       if (needle_dup) {
-               efree(needle_dup);
+
+       if(haystack_type == IS_UNICODE) {
+               U16_FWD_N(haystack.u, cu_offset, haystack_len, offset);
+               found = php_u_stristr(haystack.u + cu_offset, target.u, haystack_len - cu_offset, needle_len, 1 TSRMLS_CC);
+       } else {
+                       haystack_dup = estrndup(haystack.s, haystack_len);
+                       php_strtolower(haystack_dup, haystack_len);
+                       needle_dup = estrndup(target.s, needle_len);
+                       php_strtolower(needle_dup, Z_STRLEN_PP(needle));
+                       found = php_memnstr(haystack_dup + offset,
+                                                               needle_dup, needle_len,
+                                                               haystack_dup + haystack_len);
+                       efree(haystack_dup);
+                       efree(needle_dup);
        }
 
        if (found) {
-               if (Z_TYPE_PP(haystack) == IS_UNICODE) {
+               if (haystack_type == IS_UNICODE) {
                        /* Simple subtraction will not suffice, since there may be
                           supplementary codepoints. We count how many codepoints there are
                           between the starting offset and the found location and add them
                           to the starting codepoint offset. */
-                       RETURN_LONG(offset + u_countChar32(Z_USTRVAL_PP(haystack) + cu_offset,
-                                                                                          (UChar*)found - (Z_USTRVAL_PP(haystack) + cu_offset)));
+                       RETURN_LONG(offset + u_countChar32(haystack.u + cu_offset,
+                                                                                          (UChar*)found - (haystack.u + cu_offset)));
                } else {
-                       RETURN_LONG((char *)found - (char *)haystack_dup);
+                       RETURN_LONG((char *)found - haystack_dup);
                }
        } else {
                RETURN_FALSE;
@@ -2727,56 +2663,33 @@ PHP_FUNCTION(stripos)
    Finds position of last occurrence of a string within another string */
 PHP_FUNCTION(strrpos)
 {
-       zval **zhaystack, **zneedle;
-       zstr haystack, needle;
+       zstr haystack, target;
        int haystack_len, needle_len = 0;
-       zend_uchar str_type;
+       zend_uchar haystack_type;
+       zval **needle;
+       char needle_char[2];
+       UChar u_needle_char[3];
+       void *found = NULL;
        long offset = 0;
-       char *p, *e, ord_needle[2];
-       UChar *pos, *u_p, *u_e, u_ord_needle[3];
+       char *p, *e;
+       UChar *pos, *u_p, *u_e;
        int cu_offset = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|l",
-                                                         &zhaystack, &zneedle, &offset) == FAILURE) {
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|l", &haystack, &haystack_len, &haystack_type, &needle, &offset) == FAILURE) {
+               return;
        }
 
-       if (Z_TYPE_PP(zhaystack) != IS_UNICODE && Z_TYPE_PP(zhaystack) != IS_STRING) {
-               convert_to_unicode_ex(zhaystack);
-       }
-       if (Z_TYPE_PP(zneedle) == IS_UNICODE || Z_TYPE_PP(zneedle) == IS_STRING) {
-               if (Z_TYPE_PP(zneedle) != Z_TYPE_PP(zhaystack)) {
-                       str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_PP(zhaystack), Z_TYPE_PP(zneedle));
-                       convert_to_explicit_type_ex(zhaystack, str_type);
-                       convert_to_explicit_type_ex(zneedle, str_type);
-               }
-               needle = Z_UNIVAL_PP(zneedle);
-               needle_len = Z_UNILEN_PP(zneedle);
-       } else {
-               convert_to_long_ex(zneedle);
-               if (Z_TYPE_PP(zhaystack) == IS_UNICODE) {
-                       if (Z_LVAL_PP(zneedle) < 0 || Z_LVAL_PP(zneedle) > 0x10FFFF) {
-                               php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
-                               RETURN_FALSE;
-                       }
-                       needle_len = zend_codepoint_to_uchar((UChar32)Z_LVAL_PP(zneedle), u_ord_needle);
-                       u_ord_needle[needle_len] = 0;
-                       needle.u = u_ord_needle;
-               } else {
-                       ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
-                       ord_needle[1] = '\0';
-                       needle.s = ord_needle;
-                       needle_len = 1;
-               }
+       target = php_needle_to_type(needle, haystack_type, &needle_len, needle_char, u_needle_char);
+
+       if(target.v == NULL) {
+               RETURN_FALSE;
        }
-       haystack = Z_UNIVAL_PP(zhaystack);
-       haystack_len = Z_UNILEN_PP(zhaystack);
 
        if ((haystack_len == 0) || (needle_len == 0) || needle_len > haystack_len) {
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_PP(zhaystack) == IS_UNICODE) {
+       if (haystack_type == IS_UNICODE) {
                if (offset >= 0) {
                        U16_FWD_N(haystack.u, cu_offset, haystack_len, offset);
                        if (cu_offset > haystack_len - needle_len) {
@@ -2805,7 +2718,7 @@ PHP_FUNCTION(strrpos)
                        }
                }
 
-               pos = u_strFindLast(u_p, u_e-u_p+needle_len, needle.u, needle_len);
+               pos = u_strFindLast(u_p, u_e-u_p+needle_len, target.u, needle_len);
                if (pos) {
                        if (offset > 0) {
                                RETURN_LONG(offset + u_countChar32(u_p, (UChar*)pos - u_p));
@@ -2840,7 +2753,7 @@ PHP_FUNCTION(strrpos)
                if (needle_len == 1) {
                        /* Single character search can shortcut memcmps */
                        while (e >= p) {
-                               if (*e == *needle.s) {
+                               if (*e == *target.s) {
                                        RETURN_LONG(e - p + (offset > 0 ? offset : 0));
                                }
                                e--;
@@ -2849,7 +2762,7 @@ PHP_FUNCTION(strrpos)
                }
 
                while (e >= p) {
-                       if (memcmp(e, needle.s, needle_len) == 0) {
+                       if (memcmp(e, target.s, needle_len) == 0) {
                                RETURN_LONG(e - p + (offset > 0 ? offset : 0));
                        }
                        e--;
@@ -2864,42 +2777,27 @@ PHP_FUNCTION(strrpos)
    Finds position of last occurrence of a string within another string */
 PHP_FUNCTION(strripos)
 {
-       zstr haystack, needle;
-       zval **zneedle;
-       int needle_len, haystack_len;
+       zstr haystack, target;
+       int haystack_len, needle_len = 0;
        zend_uchar haystack_type;
+       zval **needle;
+       char needle_char[2];
+       UChar u_needle_char[3];
+       void *found = NULL;
        long offset = 0;
-       char *p, *e, needle_char[2];
+       char *p, *e;
        UChar *u_p, *u_e, *pos;
-       UChar u_needle_char[3];
-       char *needle_dup, *haystack_dup;
+       char *needle_dup = NULL, *haystack_dup = NULL;
        int cu_offset = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|l", &haystack,
-                                                         &haystack_len, &haystack_type, &zneedle, &offset) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ|l", &haystack, &haystack_len, &haystack_type, &needle, &offset) == FAILURE) {
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_PP(zneedle) == IS_STRING || Z_TYPE_PP(zneedle) == IS_UNICODE) {
-               convert_to_explicit_type_ex(zneedle, haystack_type);
-               needle = Z_UNIVAL_PP(zneedle);
-               needle_len = Z_UNILEN_PP(zneedle);
-       } else {
-               convert_to_long_ex(zneedle);
-               if (haystack_type == IS_UNICODE) {
-                       if (Z_LVAL_PP(zneedle) < 0 || Z_LVAL_PP(zneedle) > 0x10FFFF) {
-                               php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
-                               RETURN_FALSE;
-                       }
-                       needle_len = zend_codepoint_to_uchar((UChar32)Z_LVAL_PP(zneedle), u_needle_char);
-                       u_needle_char[needle_len] = 0;
-                       needle.u = u_needle_char;
-               } else {
-                       needle_char[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
-                       needle_char[1] = '\0';
-                       needle.s = needle_char;
-                       needle_len = 1;
-               }
+       target = php_needle_to_type(needle, haystack_type, &needle_len, needle_char, u_needle_char);
+
+       if(target.v == NULL) {
+               RETURN_FALSE;
        }
 
        if ((haystack_len == 0) || (needle_len == 0) || needle_len > haystack_len) {
@@ -2935,7 +2833,7 @@ PHP_FUNCTION(strripos)
                        }
                }
 
-               pos = php_u_stristr(u_p, needle.u, u_e-u_p+needle_len, needle_len, 0 TSRMLS_CC);
+               pos = php_u_stristr(u_p, target.u, u_e-u_p+needle_len, needle_len, 0 TSRMLS_CC);
                if (pos) {
                        if (offset > 0) {
                                RETURN_LONG(offset + u_countChar32(u_p, (UChar*)pos - u_p));
@@ -2966,7 +2864,7 @@ PHP_FUNCTION(strripos)
                                }
                        }
                        /* Borrow that needle_char buffer to avoid repeatedly tolower()ing needle */
-                       *needle_char = tolower(*needle.s);
+                       *needle_char = tolower(*target.s);
                        while (e >= p) {
                                if (tolower(*e) == *needle_char) {
                                        RETURN_LONG(e - p + (offset > 0 ? offset : 0));
@@ -2976,7 +2874,7 @@ PHP_FUNCTION(strripos)
                        RETURN_FALSE;
                }
 
-               needle_dup = estrndup(needle.s, needle_len);
+               needle_dup = estrndup(target.s, needle_len);
                php_strtolower(needle_dup, needle_len);
                haystack_dup = estrndup(haystack.s, haystack_len);
                php_strtolower(haystack_dup, haystack_len);
@@ -3026,55 +2924,54 @@ PHP_FUNCTION(strripos)
    Finds the last occurrence of a character in a string within another */
 PHP_FUNCTION(strrchr)
 {
-       zval *haystack, *needle;
-       zend_uchar str_type;
+       zstr haystack;
+       int haystack_len;
+       zend_uchar haystack_type;
+       zval **needle;
        UChar32 ch;
        void *found = NULL;
        int found_offset;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &haystack, &needle) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tZ", &haystack, &haystack_len, &haystack_type, &needle) == FAILURE) {
                return;
        }
-       if (Z_TYPE_P(haystack) != IS_UNICODE || Z_TYPE_P(haystack) != IS_STRING) {
-               convert_to_unicode(haystack);
-       }
 
-       if (Z_TYPE_P(needle) == IS_UNICODE || Z_TYPE_P(needle) == IS_STRING) {
-               if (Z_TYPE_P(needle) != Z_TYPE_P(haystack)) {
-                       str_type = zend_get_unified_string_type(2 TSRMLS_CC, Z_TYPE_P(haystack), Z_TYPE_P(needle));
-                       convert_to_explicit_type(haystack, str_type);
-                       convert_to_explicit_type(needle, str_type);
+       if (Z_TYPE_PP(needle) == IS_UNICODE || Z_TYPE_PP(needle) == IS_STRING) {
+               if (Z_TYPE_PP(needle) != haystack_type) {
+                       convert_to_explicit_type_ex(needle, haystack_type);
                }
-               if (Z_USTRLEN_P(needle) == 0) {
+               if (Z_USTRLEN_PP(needle) == 0) {
                        RETURN_FALSE;
                }
-               if (Z_TYPE_P(haystack) == IS_UNICODE) {
-                       ch = zend_get_codepoint_at(Z_USTRVAL_P(needle), Z_USTRLEN_P(needle), 0);
-                       found = u_memrchr32(Z_USTRVAL_P(haystack), ch, Z_USTRLEN_P(haystack));
+               if (haystack_type == IS_UNICODE) {
+                       ch = zend_get_codepoint_at(Z_USTRVAL_PP(needle), Z_USTRLEN_PP(needle), 0);
+                       found = u_memrchr32(haystack.u, ch, haystack_len);
                } else {
-                       found = zend_memrchr(Z_STRVAL_P(haystack), *Z_STRVAL_P(needle), Z_STRLEN_P(haystack));
+                       found = zend_memrchr(haystack.s, *Z_STRVAL_PP(needle), haystack_len);
                }
        } else {
-               convert_to_long(needle);
-               if (Z_TYPE_P(haystack) == IS_UNICODE) {
-                       UChar32 ch = (UChar32)Z_LVAL_P(needle);
-                       if (ch < 0 || ch > 0x10FFFF) {
+               long needleval = php_needle_char(*needle);
+               if(needleval == -1) {
+                       RETURN_FALSE;
+               }
+               if (haystack_type == IS_UNICODE) {
+                       if (needleval < 0 || needleval > 0x10FFFF) {
                                php_error(E_WARNING, "Needle argument codepoint value out of range (0 - 0x10FFFF)");
                                RETURN_FALSE;
                        }
-                       found = u_memrchr32(Z_USTRVAL_P(haystack), ch, Z_USTRLEN_P(haystack));
+                       found = u_memrchr32(haystack.u, (UChar32)needleval, haystack_len);
                } else {
-                       found = zend_memrchr(Z_STRVAL_P(haystack), (char)Z_LVAL_P(needle), Z_STRLEN_P(haystack));
+                       found = zend_memrchr(haystack.s, (char)needleval, haystack_len);
                }
        }
 
        if (found) {
-               if (Z_TYPE_P(haystack) == IS_UNICODE) {
-                       found_offset = (UChar *)found - Z_USTRVAL_P(haystack);
-                       RETURN_UNICODEL((UChar *)found, Z_USTRLEN_P(haystack) - found_offset, 1);
+               if (haystack_type == IS_UNICODE) {
+                       found_offset = (UChar *)found - haystack.u;
+                       RETURN_UNICODEL((UChar *)found, haystack_len - found_offset, 1);
                } else {
-                       found_offset = (char *)found - Z_STRVAL_P(haystack);
-                       RETURN_STRINGL((char *)found, Z_STRLEN_P(haystack) - found_offset, 1);
+                       found_offset = (char *)found - haystack.s;
+                       RETURN_STRINGL((char *)found, haystack_len - found_offset, 1);
                }
        } else {
                RETURN_FALSE;
@@ -7224,13 +7121,13 @@ PHP_FUNCTION(strnatcasecmp)
    Returns the number of times a substring occurs in the string */
 PHP_FUNCTION(substr_count)
 {
-       void *haystack, *needle;
+       zstr haystack, needle;
        int haystack_len, needle_len;
        zend_uchar haystack_type, needle_type;
        long offset = 0, length = 0;
        int ac = ZEND_NUM_ARGS();
        int count = 0;
-       void *p, *endp, *tmp;
+       zstr p, endp, tmp;
        int32_t i = 0, j;
        char cmp;
 
@@ -7246,12 +7143,11 @@ PHP_FUNCTION(substr_count)
                RETURN_FALSE;
        }
 
+       p.v = haystack.v;
        if (haystack_type == IS_UNICODE) {
-               p = (UChar *)haystack;
-               endp = (UChar *)haystack + haystack_len;
+               endp.u = haystack.u + haystack_len;
        } else {
-               p = (char *)haystack;
-               endp = (char *)haystack + haystack_len;
+               endp.s = haystack.s + haystack_len;
        }
 
        if (ac > 2) {
@@ -7260,13 +7156,20 @@ PHP_FUNCTION(substr_count)
                        RETURN_FALSE;
                }
                if (haystack_type == IS_UNICODE) {
-                       i = 0;
-                       U16_FWD_N((UChar *)haystack, i, haystack_len, offset);
-                       p = (UChar *)haystack + i;
+                       int off = offset;
+                       while(off > 0) {
+                               U16_FWD_1(haystack.u, i, offset);
+                               if(i > haystack_len) {
+                                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value %ld exceeds string length", offset);
+                                       RETURN_FALSE;
+                               }
+                               off--;
+                       }
+                       p.u = haystack.u + i;
                } else {
-                       p = (char *)haystack + offset;
+                       p.s = haystack.s + offset;
                }
-               if (p > endp) {
+               if (p.v > endp.v) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value %ld exceeds string length", offset);
                        RETURN_FALSE;
                }
@@ -7278,37 +7181,37 @@ PHP_FUNCTION(substr_count)
                        if (haystack_type == IS_UNICODE) {
                                j = i;
                                i = 0;
-                               U16_FWD_N((UChar *)p, i, haystack_len-j, length);
-                               tmp = (UChar *)p + i;
+                               U16_FWD_N(p.u, i, haystack_len-j, length);
+                               tmp.u = p.u + i;
                        } else {
-                               tmp = (char *)p + length;
+                               tmp.s = p.s + length;
                        }
-                       if (tmp > endp) {
+                       if (tmp.v > endp.v) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value %ld exceeds string length", length);
                                RETURN_FALSE;
                        } else {
-                               endp = tmp;
+                               endp.v = tmp.v;
                        }
                }
        }
 
        if (haystack_type == IS_UNICODE) {
-               while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) {
+               while ((p.u = zend_u_memnstr(p.u, needle.u, needle_len, endp.u)) != NULL) {
                        /*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */
-                       p = (UChar *)p + needle_len;
+                       p.u = p.u + needle_len;
                        count++;
                }
        } else {
                if (needle_len == 1) {
-                       cmp = ((char *)needle)[0];
-                       while ((p = memchr(p, cmp, (char *)endp - (char *)p))) {
+                       cmp = needle.s[0];
+                       while ((p.s = memchr(p.s, cmp, endp.s - p.s))) {
                                count++;
-                               p = (char *)p + 1;
+                               p.s++;
                        }
                } else {
-                       while ((p = php_memnstr((char *)p, (char *)needle, needle_len, (char *)endp))) {
+                       while ((p.s = php_memnstr(p.s, needle.s, needle_len, endp.s))) {
                                /*(char *)p += needle_len; // GCC 4.0.0 cannot compile this */
-                               p = (char *)p + needle_len;
+                               p.s += needle_len;
                                count++;
                        }
                }
@@ -7323,35 +7226,31 @@ PHP_FUNCTION(substr_count)
 PHP_FUNCTION(str_pad)
 {
        /* Input arguments */
-       void   *input;          /* Input string */
+       zstr    input;          /* Input string */
        long    pad_length;     /* Length to pad to, in codepoints for Unicode */
-       void   *padstr;         /* Padding string */
+       zstr    padstr;         /* Padding string */
        long    pad_type;       /* Padding type (left/right/both) */
        int input_len, padstr_len; /* Lengths in code units for Unicode */
-       zend_uchar input_type, padstr_type;
+       zend_uchar input_type;
 
        /* Helper variables */
        int input_codepts;      /* Number of codepts in Unicode input */
        int     num_pad_chars;  /* Number of padding characters (total - input size) */
-       void   *result = NULL;  /* Resulting string */
+       zstr   result;      /* Resulting string */
        int32_t result_len = 0; /* Length of the resulting string */
        int32_t i, j, left_pad=0, right_pad=0;
        UChar32 ch;
 
-
-       if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 4) {
-               WRONG_PARAM_COUNT;
-       }
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Tl|Tl",
                                                          &input, &input_len, &input_type, &pad_length,
-                                                         &padstr, &padstr_len, &padstr_type, &pad_type) == FAILURE) {
+                                                         &padstr, &padstr_len, &input_type, &pad_type) == FAILURE) {
                return;
        }
 
        if (input_type == IS_UNICODE) {
                /* For Unicode, num_pad_chars/pad_length is number of codepoints */
                i = 0; input_codepts = 0;
-               input_codepts = u_countChar32((UChar *)input, input_len);
+               input_codepts = u_countChar32(input.u, input_len);
                num_pad_chars = pad_length - input_codepts;
        } else {
                num_pad_chars = pad_length - input_len;
@@ -7359,11 +7258,7 @@ PHP_FUNCTION(str_pad)
        /* If resulting string turns out to be shorter than input string,
           we simply copy the input and return. */
        if (pad_length < 0 || num_pad_chars < 0) {
-               if (input_type == IS_UNICODE) {
-                       RETURN_UNICODEL((UChar *)input, input_len, 1);
-               } else {
-                       RETURN_STRINGL((char *)input, input_len, 1);
-               }
+               RETURN_ZSTRL(input_type, input, input_len, 1);
        }
 
        /* Setup the padding string values if NOT specified. */
@@ -7382,18 +7277,18 @@ PHP_FUNCTION(str_pad)
                }
        } else {
                if (input_type == IS_UNICODE) {
-                       padstr = USTR_MAKE(" ");
+                       padstr.u = USTR_MAKE(" ");
                } else {
-                       padstr = " ";
+                       padstr.s = " ";
                }
                padstr_len = 1;
                pad_type = STR_PAD_RIGHT;
        }
 
        if (input_type == IS_UNICODE) {
-               result = eumalloc(input_len + num_pad_chars*2 + 1);
+               result.u = eumalloc(input_len + num_pad_chars*2 + 1);
        } else {
-               result = emalloc(input_len + num_pad_chars + 1);
+               result.s = emalloc(input_len + num_pad_chars + 1);
        }
 
        /* We need to figure out the left/right padding lengths. */
@@ -7419,39 +7314,35 @@ PHP_FUNCTION(str_pad)
                        if (j >= padstr_len) {
                                j = 0;
                        }
-                       U16_NEXT((UChar *)padstr, j, padstr_len, ch);
-                       result_len += zend_codepoint_to_uchar(ch, (UChar *)result + result_len);
+                       U16_NEXT(padstr.u, j, padstr_len, ch);
+                       result_len += zend_codepoint_to_uchar(ch, result.u + result_len);
                }
-               memcpy((UChar *)result + result_len, input, UBYTES(input_len));
+               memcpy(result.u + result_len, input.u, UBYTES(input_len));
                result_len += input_len;
                j = 0;
                for (i = 0; i < right_pad; i++) {
                        if (j >= padstr_len) {
                                j = 0;
                        }
-                       U16_NEXT((UChar *)padstr, j, padstr_len, ch);
-                       result_len += zend_codepoint_to_uchar(ch, (UChar *)result + result_len);
+                       U16_NEXT(padstr.u, j, padstr_len, ch);
+                       result_len += zend_codepoint_to_uchar(ch, result.u + result_len);
                }
-               *((UChar *)result + result_len) = 0;
-               result = eurealloc(result, result_len+1);
+               result.u[result_len] = 0;
+               result.u = eurealloc(result.u, result_len+1);
        } else {
                for (i = 0; i < left_pad; i++)
-                       *((char *)result + result_len++) = *((char *)padstr + (i % padstr_len));
-               memcpy((char *)result + result_len, input, input_len);
+                       result.s[result_len++] = padstr.s[i % padstr_len];
+               memcpy(result.s + result_len, input.s, input_len);
                result_len += input_len;
                for (i = 0; i < right_pad; i++)
-                       *((char *)result + result_len++) = *((char *)padstr + (i % padstr_len));
-               *((char *)result + result_len) = '\0';
+                       result.s[result_len++] = padstr.s[i % padstr_len];
+               result.s[result_len] = '\0';
        }
 
-       if (input_type == IS_UNICODE) {
-               if (ZEND_NUM_ARGS() < 3) {
-                       efree(padstr);
-               }
-               RETURN_UNICODEL((UChar *)result, result_len, 0);
-       } else {
-               RETURN_STRINGL((char *)result, result_len, 0);
+       if (input_type == IS_UNICODE && ZEND_NUM_ARGS() < 3) {
+                       efree(padstr.u);
        }
+       RETURN_ZSTRL(input_type, result, result_len, 0);
 }
 /* }}} */
 
@@ -7906,6 +7797,11 @@ PHP_FUNCTION(substr_compare)
                RETURN_FALSE;
        }
 
+       if (offset >= s1_len) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
+               RETURN_FALSE;
+       }
+
        if (str_type == IS_UNICODE) {
                /* calculate starting offset of the segment */
                if (offset < 0) {
@@ -7927,13 +7823,12 @@ PHP_FUNCTION(substr_compare)
                                U16_FWD_1_UNSAFE(s1.u, end_offset);
                                --len;
                        }
-
+                       cmp_len = end_offset - start_offset; 
                } else {
                        end_offset = s1_len;
+                       cmp_len = MAX(s2_len, (end_offset - start_offset));
                }
 
-               cmp_len = MAX(s2_len, (end_offset - start_offset));
-
                if (!cs) {
                        RETURN_LONG(zend_u_binary_strncmp(s1.u + start_offset, (s1_len - start_offset), s2.u, s2_len, cmp_len));
                } else {
@@ -7945,11 +7840,6 @@ PHP_FUNCTION(substr_compare)
                        offset = (offset < 0) ? 0 : offset;
                }
 
-               if (offset >= s1_len) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
-                       RETURN_FALSE;
-               }
-
                if (len > s1_len - offset) {
                        len = s1_len - offset;
                }
index 7f88d45f576d68b146e7e328b880f0dc7601c333..cef8ed4caec65a36b801a339b71f72ece53a0e62 100644 (file)
@@ -616,133 +616,133 @@ int(0)
 --- Iteration 0 ---
 -- String after replacing the search value is => --
 unicode(177) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!FOUND 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!FOUND 
            ?FOUND chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '2' times
 
 --- Iteration 1 ---
 -- String after replacing the search value is => --
 unicode(177) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!FOUND 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!FOUND 
            ?FOUND chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '2' times
 
 --- Iteration 2 ---
 -- String after replacing the search value is => --
 unicode(182) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: FOUND 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: FOUND 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 3 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 4 ---
 -- String after replacing the search value is => --
 unicode(182) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $FOUND: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $FOUND: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 5 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 6 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 7 ---
 -- String after replacing the search value is => --
 unicode(189) "Hello, world,0120333.3445FOUND67          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 8 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 9 ---
 -- String after replacing the search value is => --
 unicode(193) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0FOUND \xXYZ   FOUND $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0FOUND \xXYZ  FOUND $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '2' times
 
 --- Iteration 10 ---
 -- String after replacing the search value is => --
 unicode(193) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xFOUND  abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xFOUND abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 11 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 12 ---
 -- String after replacing the search value is => --
 unicode(192) "Hello, world,0120333.3445-1.234567          FOUND TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 13 ---
 -- String after replacing the search value is => --
 unicode(207) "Hello, world,FOUND12FOUND333.3445-1.234567          NULL TRUE FALSE\0
-           \0FOUND«CD\0abcd \xXYZ        abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \0FOUND«CD\0abcd \xXYZ       abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(FOUND).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '4' times
 
 --- Iteration 14 ---
 -- String after replacing the search value is => --
 unicode(207) "Hello, world,FOUND12FOUND333.3445-1.234567          NULL TRUE FALSE\0
-           \0FOUND«CD\0abcd \xXYZ        abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \0FOUND«CD\0abcd \xXYZ       abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(FOUND).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '4' times
 
 --- Iteration 15 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 16 ---
 -- String after replacing the search value is => --
 unicode(307) "Hello,FOUNDworld,0120333.3445-1.234567FOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDNULLFOUNDTRUEFOUNDFALSE\0
-FOUND  FOUNDFOUNDFOUNDFOUND\00«CD\0abcdFOUND\xXYZ        abcdFOUND$$@#%^&*!~,.:;?:FOUND!!Hello,FOUNDWorldFOUND
+FOUND  FOUNDFOUNDFOUNDFOUND\00«CD\0abcdFOUND\xXYZ       abcdFOUND$$@#%^&*!~,.:;?:FOUND!!Hello,FOUNDWorldFOUND
        FOUNDFOUNDFOUNDFOUND?Hello,FOUNDWorldFOUNDchr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '29' times
 
 --- Iteration 17 ---
 -- String after replacing the search value is => --
 unicode(203) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSEFOUND
-           FOUND0«CDFOUNDabcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           FOUND0«CDFOUNDabcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '3' times
 
 --- Iteration 18 ---
 -- String after replacing the search value is => --
 unicode(194) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           FOUND«CD\0abcd \xXYZ abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           FOUND«CD\0abcd \xXYZ        abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
@@ -756,98 +756,98 @@ unicode(194) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
 --- Iteration 20 ---
 -- String after replacing the search value is => --
 unicode(194) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           FOUND«CD\0abcd \xXYZ abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           FOUND«CD\0abcd \xXYZ        abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 21 ---
 -- String after replacing the search value is => --
 unicode(194) "Hello, world,0120333FOUND445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 22 ---
 -- String after replacing the search value is => --
 unicode(203) "Hello, world,0FOUND20333.3445-FOUND.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(FOUND28).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '3' times
 
 --- Iteration 23 ---
 -- String after replacing the search value is => --
 unicode(192) "Hello, world,0120333.3445-1.234567          NULL FOUND FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 24 ---
 -- String after replacing the search value is => --
 unicode(203) "Hello, world,0FOUND20333.3445-FOUND.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(FOUND28).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '3' times
 
 --- Iteration 25 ---
 -- String after replacing the search value is => --
 unicode(203) "Hello, world,0FOUND20333.3445-FOUND.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(FOUND28).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '3' times
 
 --- Iteration 26 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 27 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FOUND\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 28 ---
 -- String after replacing the search value is => --
 unicode(307) "Hello,FOUNDworld,0120333.3445-1.234567FOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDNULLFOUNDTRUEFOUNDFALSE\0
-FOUND  FOUNDFOUNDFOUNDFOUND\00«CD\0abcdFOUND\xXYZ        abcdFOUND$$@#%^&*!~,.:;?:FOUND!!Hello,FOUNDWorldFOUND
+FOUND  FOUNDFOUNDFOUNDFOUND\00«CD\0abcdFOUND\xXYZ       abcdFOUND$$@#%^&*!~,.:;?:FOUND!!Hello,FOUNDWorldFOUND
        FOUNDFOUNDFOUNDFOUND?Hello,FOUNDWorldFOUNDchr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '29' times
 
 --- Iteration 29 ---
 -- String after replacing the search value is => --
 unicode(186) "Hello, world,0120333.3445-1.234567FOUNDNULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '1' times
 
 --- Iteration 30 ---
 -- String after replacing the search value is => --
 unicode(199) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0aFOUNDcd \xXYZ        aFOUNDcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0aFOUNDcd \xXYZ       aFOUNDcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '2' times
 
 --- Iteration 31 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
 --- Iteration 32 ---
 -- String after replacing the search value is => --
 unicode(203) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
- FOUND    \00«CD\0abcd \xXYZFOUNDabcd $$@#%^&*!~,.:;?: !!Hello, World 
+ FOUND    \00«CD\0abcd \xXYZFOUNDabcd $$@#%^&*!~,.:;?: !!Hello, World 
 FOUND    ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '3' times
 
 --- Iteration 33 ---
 -- String after replacing the search value is => --
 unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
-           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           \00«CD\0abcd \xXYZ   abcd $$@#%^&*!~,.:;?: !!Hello, World 
            ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
 -- search string has found '0' times
 
index ef0efe5b236c8aa1c3ac9b27e2637f732b091a75..d7c379b0d2e0cbec2d524978367b21e925dfcd1a 100644 (file)
@@ -28,7 +28,7 @@ stripos() function test
 
        echo "Done\n";
 ?>
---EXPECT--
+--EXPECTF--
 int(0)
 int(5)
 int(5)
@@ -38,6 +38,8 @@ int(2)
 int(0)
 int(0)
 bool(false)
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
 bool(false)
 bool(false)
index 7aeda4082c28f7500c68315e310eff40b33ff943..e2bd6dc494cd2249ea61babc450e65b4ce3a96ce 100644 (file)
@@ -129,7 +129,11 @@ bool(false)
 int(8)
 bool(false)
 -- Iteration 16 --
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 17 --
 int(10)
index ea29521100bd74321ea431adf192519e9578b466..bafcd2e040e57f5fdd4ed154c23b4011cef1894c 100644 (file)
@@ -127,18 +127,28 @@ bool(false)
 bool(false)
 
 -- Iteration 10 --
+
+Warning: stripos(): needle is not a string or an integer in %s on line %d
 bool(false)
 
 -- Iteration 11 --
+
+Warning: stripos(): needle is not a string or an integer in %s on line %d
 bool(false)
 
 -- Iteration 12 --
+
+Warning: stripos(): needle is not a string or an integer in %s on line %d
 bool(false)
 
 -- Iteration 13 --
+
+Warning: stripos(): needle is not a string or an integer in %s on line %d
 bool(false)
 
 -- Iteration 14 --
+
+Warning: stripos(): needle is not a string or an integer in %s on line %d
 bool(false)
 
 -- Iteration 15 --
@@ -159,9 +169,13 @@ Notice: Object of class sample could not be converted to int in %s on line %d
 bool(false)
 
 -- Iteration 20 --
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
 
 -- Iteration 21 --
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
 
 -- Iteration 22 --
index 540cbd2ff97ad33ea8a9f6d3449a9af965a7a815..eaa05adc51aa6fb146bfe0bc6ae79581fc73b4d2 100644 (file)
@@ -131,39 +131,39 @@ bool(false)
 bool(false)
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 11 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 12 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 13 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 14 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 15 --
 bool(false)
 bool(false)
@@ -208,8 +208,12 @@ bool(false)
 Warning: stripos(): Offset not contained in string in %s on line %d
 bool(false)
 -- Iteration 24 --
-bool(false)
-bool(false)
+
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
+
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 -- Iteration 25 --
 bool(false)
 
index 16360f5c6dc90ebca6203a70b36dc10609562d4d..95f74b61b9cd2882df075dfb6eb35fda16a96f82 100644 (file)
@@ -118,23 +118,23 @@ bool(false)
 bool(false)
 -- Iteration 10 --
 
-Warning: stripos() expects parameter 3 to be long, array given in %s on line %d
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
 NULL
 -- Iteration 11 --
 
-Warning: stripos() expects parameter 3 to be long, array given in %s on line %d
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
 NULL
 -- Iteration 12 --
 
-Warning: stripos() expects parameter 3 to be long, array given in %s on line %d
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
 NULL
 -- Iteration 13 --
 
-Warning: stripos() expects parameter 3 to be long, array given in %s on line %d
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
 NULL
 -- Iteration 14 --
 
-Warning: stripos() expects parameter 3 to be long, array given in %s on line %d
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
 NULL
 -- Iteration 15 --
 bool(false)
@@ -162,7 +162,7 @@ bool(false)
 bool(false)
 -- Iteration 24 --
 
-Warning: stripos() expects parameter 3 to be long, resource given in %s on line %d
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
 NULL
 -- Iteration 25 --
 bool(false)
index 0ba417de4d7a143d171951772e37090c86d46990..b696c8ecacb952c4ac490410dbf073a794d67e31 100644 (file)
@@ -82,7 +82,7 @@ for($index=0; $index<count($needle); $index++) {
 }
 echo "*** Done ***";
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing stripos() function: with single quoted strings ***
 -- Iteration 1 --
 int(2)
@@ -130,7 +130,11 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 16 --
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 17 --
 int(14)
index 3310ecd26f66f443353bc9bbde340f227ebf3659..258464bb1876c55e90ea9e001fe54e4a97d1583e 100644 (file)
@@ -24,12 +24,14 @@ var_dump( stripos($multi_line_str, " ") );
 
 echo "*** Done ***";
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing stripos() function: with heredoc strings ***
 -- With heredoc string containing multi lines --
 int(14)
 int(23)
 int(23)
+
+Warning: stripos(): Empty delimiter in %s on line %d
 bool(false)
 int(7)
 *** Done ***
index 993b8f1e061db806289bdf9f96539baa7615b402..bea945e4400d983fa5ccf002c594d74a5c990d57 100644 (file)
@@ -121,28 +121,28 @@ bool(false)
 
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 11 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 12 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 13 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 14 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 15 --
 bool(false)
@@ -172,7 +172,9 @@ bool(false)
 bool(false)
 
 -- Iteration 24 --
-bool(false)
+
+Warning: stripos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 
 -- Iteration 25 --
 bool(false)
index f336d3598f2934e5c4559b29bbe10732d1cd0af8..b2cd572944560398f30bf751d7916d19226b43fe 100644 (file)
@@ -24,14 +24,14 @@ stristr() function
 Warning: stristr() expects at least 2 parameters, 0 given in %s on line %d
 NULL
 
-Notice: Array to string conversion in %s on line %d
+Warning: stristr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Warning: stristr(): Empty delimiter in %s on line %d
-bool(false)
+Warning: stristr(): needle is not a string or an integer in %s on line %d
 bool(false)
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: stristr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 unicode(11) "tEsT sTrInG"
 unicode(6) "sTrInG"
 unicode(6) "sTrInG"
index a2c821df61acf4636c8dabecde682214258207f7..a39d94206fa70d4c67756a38c1a5b058636ef8f0 100644 (file)
@@ -98,16 +98,16 @@ bool(false)
 bool(false)
 -- Iteration 8 --
 
-Notice: Array to string conversion in %s on line %d2
-bool(false)
+Warning: stristr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 9 --
 
-Notice: Array to string conversion in %s on line %d2
-bool(false)
+Warning: stristr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d2
-bool(false)
+Warning: stristr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 11 --
 bool(false)
 -- Iteration 12 --
@@ -123,7 +123,9 @@ bool(false)
 -- Iteration 17 --
 unicode(7) " object"
 -- Iteration 18 --
-unicode(%d) " id #%d"
+
+Warning: stristr() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 -- Iteration 19 --
 bool(false)
 -- Iteration 20 --
index 1f6f2da4f65758d8884e6c84003ba8004e531dad..2acb892c4ece65a068394af6581af485d8eee75e 100644 (file)
@@ -105,10 +105,16 @@ bool(false)
 Warning: Needle argument codepoint value out of range (0 - 0x10FFFF) in %s on line %d
 bool(false)
 -- Iteration 8 --
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 9 --
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 10 --
+
+Warning: stristr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 11 --
 bool(false)
index a7719b63af40272f98b44c37a35b9d8a68289521..af50e7074ca7d586aa65e3ca24e9428972144d0b 100644 (file)
@@ -28,6 +28,7 @@ echo "\n-- Checking with out of character's range, given in binary format --\n";
 /* Checking with the out of range ASCII value(given in binary format) */ 
 $str1 = decbin(256);
 $str2 = decbin( ord( chr(256) ));
+var_dump($str1, $str2);
 var_dump( strncmp($str1, $str2, 8) );  //comparing all the 8-bits; expected: int(1)
 
 echo "\n*** Done ***\n";
index fd6494503b9fd475ba4c2648da8645919562b84e..a1796a828427c5035e8245d0dba12533fcd2a1f2 100644 (file)
@@ -156,14 +156,24 @@ bool(false)
 -- Iteration 9 --
 bool(false)
 -- Iteration 10 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 11 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 12 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 13 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 14 --
+
+Warning: strrchr(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 15 --
 bool(false)
index 05e8d2f7a39e74d9178389d2894ac54d9ccc01b8..03c4f54e193af61dcb8116f0629416f9f15046a4 100644 (file)
@@ -116,24 +116,24 @@ bool(false)
 bool(false)
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 11 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 12 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 13 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 14 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 15 --
 bool(false)
 -- Iteration 16 --
@@ -155,7 +155,9 @@ bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
-%s
+
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
index 898e3fe4d192a014ca27a6f991a83844bf23ea41..b6c44f3138c8b3475c80c6d9d8c3a6a07dc0c144 100644 (file)
Binary files a/ext/standard/tests/strings/strrchr_variation12.phpt and b/ext/standard/tests/strings/strrchr_variation12.phpt differ
index cd3ad6060bc131fc982e71ff476b522fa0cc3eef..14bb42ebb8ffa7f406fbdaea2b402b5a7bed9889 100644 (file)
@@ -151,24 +151,24 @@ unicode(7) "1.06E-9"
 unicode(2) ".5"
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d
-unicode(2) "ay"
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 11 --
 
-Notice: Array to string conversion in %s on line %d
-unicode(2) "ay"
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 12 --
 
-Notice: Array to string conversion in %s on line %d
-unicode(3) "ray"
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 13 --
 
-Notice: Array to string conversion in %s on line %d
-unicode(1) "y"
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 14 --
 
-Notice: Array to string conversion in %s on line %d
-unicode(2) "ay"
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 15 --
 bool(false)
 -- Iteration 16 --
@@ -188,7 +188,9 @@ bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
-unicode(%d) "Resource id #5"
+
+Warning: strrchr() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
index b8a8943d0959b5a266901559c32133c1722628ad..3c8e003367e8819b753e88ddef8e347128479b30 100644 (file)
@@ -152,9 +152,17 @@ int(8)
 bool(false)
 int(8)
 -- Iteration 16 --
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 17 --
 int(43)
index d8caf73742c72d95a9fe69b80376885bbf57df97..cbe0fc20603d414d27ef2dc116fd27b954720026 100644 (file)
@@ -75,7 +75,7 @@ foreach ($needles as $needle) {
 }
 ?>
 ===DONE===
---EXPECT--
+--EXPECTF--
 *** Testing strripos() function: with single quoted strings ***
 -- Iteration 1 --
 int(32)
@@ -153,9 +153,17 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 16 --
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 17 --
 int(53)
index c38010634186fd93066194e3b760cccba05ab09a..0a400259086103a12642dba62156e79875008aa6 100644 (file)
@@ -37,7 +37,7 @@ var_dump( strripos($multi_line_str, " ") );
 
 ?>
 ===DONE===
---EXPECT--
+--EXPECTF--
 *** Testing strripos() function: with heredoc strings ***
 -- With heredoc string containing multi lines --
 
@@ -54,6 +54,8 @@ bool(false)
 -- Multi line strings with no offset -- 
 int(18)
 int(31)
+
+Warning: strripos(): Empty delimiter in %s on line %d
 bool(false)
 int(55)
 ===DONE===
index 3900ceaa5d7ceec890fef906e5f1ebcb491eebf8..85354942191889ce3b003d4d74e7cf1790ef50fa 100644 (file)
@@ -22,13 +22,13 @@ echo "*** Done ***";
 *** Testing strrpos() function: error conditions ***
 -- With Zero arguments --
 Warning: strrpos() expects at least 2 parameters, 0 given in %s on line %d
-bool(false)
+NULL
 
 -- With less than expected number of arguments --
 Warning: strrpos() expects at least 2 parameters, 1 given in %s on line %d
-bool(false)
+NULL
 
 -- With more than expected number of arguments --
 Warning: strrpos() expects at most 3 parameters, 4 given in %s on line %d
-bool(false)
+NULL
 *** Done ***
index 373cf1798838106e77564123dcc68186d1caa18c..f65f83f4d625c826d17fe97f2a70ceebb1085f7a 100644 (file)
@@ -120,7 +120,11 @@ bool(false)
 int(8)
 bool(false)
 -- Iteration 16 --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 17 --
 int(43)
index 5c6d3542ab583eae9367227af8b6eb76d5e971c1..bdb64f71833053228e226c5a164c0550d7a07e1c 100644 (file)
@@ -118,14 +118,24 @@ bool(false)
 -- Iteration 9 --
 bool(false)
 -- Iteration 10 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 11 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 12 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 13 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 14 --
+
+Warning: strrpos(): needle is not a string or an integer in %s on line %d
 bool(false)
 -- Iteration 15 --
 bool(false)
@@ -140,8 +150,12 @@ bool(false)
 Notice: Object of class sample could not be converted to int in %s on line %d
 bool(false)
 -- Iteration 20 --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 21 --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 22 --
 bool(false)
index c0b2c04f3e892219cbd65d4f3484c88cdd7f2535..40994e3bd5cf7c16c03f482f9dba6df355fe05ba 100644 (file)
@@ -135,39 +135,39 @@ bool(false)
 bool(false)
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 11 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 12 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 13 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 14 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 15 --
 bool(false)
 
@@ -192,10 +192,18 @@ bool(false)
 Notice: Object of class sample could not be converted to int in %s on line %d
 bool(false)
 -- Iteration 20 --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 21 --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 22 --
 bool(false)
@@ -204,8 +212,12 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 24 --
-bool(false)
-bool(false)
+
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
+
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 -- Iteration 25 --
 bool(false)
 bool(false)
index f48419ecd96313e4273773d8b4a9694011eb73f3..c7f9a0426c5dbc28983cbebf50fa8dbbaf1d07b2 100644 (file)
@@ -103,23 +103,23 @@ int(6)
 -- Iteration 6 --
 
 Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+NULL
 -- Iteration 7 --
 
 Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+NULL
 -- Iteration 8 --
 
 Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+NULL
 -- Iteration 9 --
 
 Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+NULL
 -- Iteration 10 --
 
 Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+NULL
 -- Iteration 11 --
 int(6)
 -- Iteration 12 --
@@ -131,15 +131,15 @@ int(6)
 -- Iteration 15 --
 
 Warning: strrpos() expects parameter 3 to be long, object given in %s on line %d
-bool(false)
+NULL
 -- Iteration 16 --
 
 Warning: strrpos() expects parameter 3 to be long, Unicode string given in %s on line %d
-bool(false)
+NULL
 -- Iteration 17 --
 
 Warning: strrpos() expects parameter 3 to be long, Unicode string given in %s on line %d
-bool(false)
+NULL
 -- Iteration 18 --
 int(6)
 -- Iteration 19 --
@@ -147,7 +147,7 @@ int(6)
 -- Iteration 20 --
 
 Warning: strrpos() expects parameter 3 to be long, resource given in %s on line %d
-bool(false)
+NULL
 -- Iteration 21 --
 int(6)
 -- Iteration 22 --
index f4958f31343e81f1d158456650acc01a2ffd19b8..c7b3a6036a851f089c6bb5e8b36fe6ca5d3834e1 100644 (file)
@@ -120,24 +120,24 @@ bool(false)
 bool(false)
 -- Iteration 10 --
 
-Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 11 --
 
-Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 12 --
 
-Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 13 --
 
-Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 14 --
 
-Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 -- Iteration 15 --
 
 Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
@@ -153,23 +153,23 @@ bool(false)
 -- Iteration 19 --
 
 Warning: strrpos() expects parameter 3 to be long, object given in %s on line %d
-bool(false)
+NULL
 -- Iteration 20 --
 
 Warning: strrpos() expects parameter 3 to be long, Unicode string given in %s on line %d
-bool(false)
+NULL
 -- Iteration 21 --
 
 Warning: strrpos() expects parameter 3 to be long, Unicode string given in %s on line %d
-bool(false)
+NULL
 -- Iteration 22 --
 bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
 
-Warning: strrpos() expects parameter 3 to be long, resource given in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 -- Iteration 25 --
 bool(false)
 -- Iteration 26 --
index 4b88363f3a604b0aa26a9fbad76c91139ea10452..992dc17e0432a37bb5ce77909d0f13ba9e4912e4 100644 (file)
@@ -121,7 +121,11 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 16 --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 17 --
 int(53)
index 286e5f6d7fb83087644698be1fdb3fbb20948e58..9fb9a38c8aa0ab384d40fdcf23abd81360e75b75 100644 (file)
@@ -26,12 +26,14 @@ var_dump( strrpos($multi_line_str, " ") );
 
 echo "*** Done ***";
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing strrpos() function: with heredoc strings ***
 -- With heredoc string containing multi lines --
 int(44)
 int(44)
 int(44)
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 int(55)
 *** Done ***
index 9c487d1e62e4c3a44cec26c54c18417a330014c1..777ca9de1644ca28a39978099fcde443ac66ef50 100644 (file)
@@ -22,10 +22,14 @@ var_dump( strrpos($empty_string, NULL) );
 
 echo "*** Done ***";
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing strrpos() function: with heredoc strings ***
 -- With empty heredoc string --
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
+
+Warning: strrpos(): Empty delimiter in %s on line %d
 bool(false)
 bool(false)
 bool(false)
index cc73d8f26dbea3037c18e3d02b67dcd616b05912..dad7642cb9cdac2a678f0439fb72e544698a5089 100644 (file)
@@ -121,28 +121,28 @@ bool(false)
 
 -- Iteration 10 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 11 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 12 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 13 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 14 --
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 -- Iteration 15 --
 bool(false)
@@ -172,7 +172,9 @@ bool(false)
 bool(false)
 
 -- Iteration 24 --
-bool(false)
+
+Warning: strrpos() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d
+NULL
 
 -- Iteration 25 --
 bool(false)
index 84448332165ed7900e9aa8b109156cb8e02d0b8c..0039bf5d166f5032b2c43c7c9f8292d5cd2259fb 100644 (file)
Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ
index 772b95cff1d0cfb4577ee486764a349d3bbb6243..75deaab131b7c101e46ca1a04ff82154d15893fe 100644 (file)
@@ -55,7 +55,7 @@ bool(false)
 
 Notice: Undefined variable: str in %s on line %d
 
-Warning: substr_count() expects parameter 3 to be long, string given in %s on line %d
+Warning: substr_count() expects parameter 3 to be long, Unicode string given in %s on line %d
 NULL
 
 Notice: Undefined variable: str in %s on line %d