]> granicus.if.org Git - php/commitdiff
Always treat needles as strings
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 29 Jan 2019 09:02:03 +0000 (10:02 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 29 Jan 2019 10:10:47 +0000 (11:10 +0100)
This is part of https://wiki.php.net/rfc/deprecations_php_7_3.

31 files changed:
UPGRADING
ext/standard/string.c
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/stristr.phpt
ext/standard/tests/strings/stristr2.phpt
ext/standard/tests/strings/stristr_variation2.phpt
ext/standard/tests/strings/strpos.phpt
ext/standard/tests/strings/strpos_number.phpt
ext/standard/tests/strings/strrchr_variation1.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_variation2.phpt
ext/standard/tests/strings/strrchr_variation8.phpt
ext/standard/tests/strings/strripos_offset.phpt
ext/standard/tests/strings/strripos_variation1.phpt
ext/standard/tests/strings/strripos_variation2.phpt
ext/standard/tests/strings/strrpos_offset.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_variation15.phpt [deleted file]
ext/standard/tests/strings/strrpos_variation2.phpt
ext/standard/tests/strings/strrpos_variation7.phpt
ext/standard/tests/strings/strstr.phpt
tests/strings/001.phpt

index 98667b0091792ff197d404f52d35a6f191c802cf..d338af2928e4d49518f63959d48bfc5e4c278e2f 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -76,6 +76,11 @@ PHP 8.0 UPGRADE NOTES
   . parse_str() can no longer be used without specifying a result array.
   . fgetss() has been removed.
   . The string.strip_tags filter has been removed.
+  . The needle argument of strpos(), strrpos(), stripos(), strripos(), strstr(),
+    strchr(), strrchr(), and stristr() will now always be interpreted as a
+    string. Previously non-string needles were interpreted as an ASCII code
+    point. An explicit call to chr() can be used to restore the previous
+    behavior.
 
 - Zlib:
   . gzgetss() has been removed.
index 068c6e82c4465d5b7a3c376b4242b7366543e930..18ca7e994700ca8b29785ea58219a353b9d9e1e6 100644 (file)
@@ -1813,79 +1813,34 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
 }
 /* }}} */
 
-/* {{{ php_needle_char
- */
-static int php_needle_char(zval *needle, char *target)
-{
-       switch (Z_TYPE_P(needle)) {
-               case IS_LONG:
-                       *target = (char)Z_LVAL_P(needle);
-                       return SUCCESS;
-               case IS_NULL:
-               case IS_FALSE:
-                       *target = '\0';
-                       return SUCCESS;
-               case IS_TRUE:
-                       *target = '\1';
-                       return SUCCESS;
-               case IS_DOUBLE:
-                       *target = (char)(int)Z_DVAL_P(needle);
-                       return SUCCESS;
-               case IS_OBJECT:
-                       *target = (char) zval_get_long(needle);
-                       return SUCCESS;
-               default:
-                       php_error_docref(NULL, E_WARNING, "needle is not a string or an integer");
-                       return FAILURE;
-       }
-}
-/* }}} */
-
 /* {{{ proto string stristr(string haystack, string needle[, bool part])
    Finds first occurrence of a string within another, case insensitive */
 PHP_FUNCTION(stristr)
 {
-       zval *needle;
-       zend_string *haystack;
+       zend_string *haystack, *needle;
        const char *found = NULL;
        size_t  found_offset;
        char *haystack_dup;
-       char needle_char[2];
+       char *orig_needle;
        zend_bool part = 0;
 
        ZEND_PARSE_PARAMETERS_START(2, 3)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(needle)
+               Z_PARAM_STR(needle)
                Z_PARAM_OPTIONAL
                Z_PARAM_BOOL(part)
        ZEND_PARSE_PARAMETERS_END();
 
-       haystack_dup = estrndup(ZSTR_VAL(haystack), ZSTR_LEN(haystack));
-
-       if (Z_TYPE_P(needle) == IS_STRING) {
-               char *orig_needle;
-               if (!Z_STRLEN_P(needle)) {
-                       php_error_docref(NULL, E_WARNING, "Empty needle");
-                       efree(haystack_dup);
-                       RETURN_FALSE;
-               }
-               orig_needle = estrndup(Z_STRVAL_P(needle), Z_STRLEN_P(needle));
-               found = php_stristr(haystack_dup, orig_needle, ZSTR_LEN(haystack), Z_STRLEN_P(needle));
-               efree(orig_needle);
-       } else {
-               if (php_needle_char(needle, needle_char) != SUCCESS) {
-                       efree(haystack_dup);
-                       RETURN_FALSE;
-               }
-               needle_char[1] = 0;
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               found = php_stristr(haystack_dup, needle_char, ZSTR_LEN(haystack), 1);
+       if (!ZSTR_LEN(needle)) {
+               php_error_docref(NULL, E_WARNING, "Empty needle");
+               RETURN_FALSE;
        }
 
+       haystack_dup = estrndup(ZSTR_VAL(haystack), ZSTR_LEN(haystack));
+       orig_needle = estrndup(ZSTR_VAL(needle), ZSTR_LEN(needle));
+       found = php_stristr(haystack_dup, orig_needle, ZSTR_LEN(haystack), ZSTR_LEN(needle));
+       efree(orig_needle);
+
        if (found) {
                found_offset = found - haystack_dup;
                if (part) {
@@ -1905,40 +1860,25 @@ PHP_FUNCTION(stristr)
    Finds first occurrence of a string within another */
 PHP_FUNCTION(strstr)
 {
-       zval *needle;
-       zend_string *haystack;
+       zend_string *haystack, *needle;
        const char *found = NULL;
-       char needle_char[2];
        zend_long found_offset;
        zend_bool part = 0;
 
        ZEND_PARSE_PARAMETERS_START(2, 3)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(needle)
+               Z_PARAM_STR(needle)
                Z_PARAM_OPTIONAL
                Z_PARAM_BOOL(part)
        ZEND_PARSE_PARAMETERS_END();
 
-       if (Z_TYPE_P(needle) == IS_STRING) {
-               if (!Z_STRLEN_P(needle)) {
-                       php_error_docref(NULL, E_WARNING, "Empty needle");
-                       RETURN_FALSE;
-               }
-
-               found = php_memnstr(ZSTR_VAL(haystack), Z_STRVAL_P(needle), Z_STRLEN_P(needle), ZSTR_VAL(haystack) + ZSTR_LEN(haystack));
-       } else {
-               if (php_needle_char(needle, needle_char) != SUCCESS) {
-                       RETURN_FALSE;
-               }
-               needle_char[1] = 0;
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               found = php_memnstr(ZSTR_VAL(haystack), needle_char, 1, ZSTR_VAL(haystack) + ZSTR_LEN(haystack));
+       if (!ZSTR_LEN(needle)) {
+               php_error_docref(NULL, E_WARNING, "Empty needle");
+               RETURN_FALSE;
        }
 
+       found = php_memnstr(ZSTR_VAL(haystack), ZSTR_VAL(needle), ZSTR_LEN(needle), ZSTR_VAL(haystack) + ZSTR_LEN(haystack));
+
        if (found) {
                found_offset = found - ZSTR_VAL(haystack);
                if (part) {
@@ -1959,15 +1899,13 @@ PHP_FUNCTION(strstr)
    Finds position of first occurrence of a string within another */
 PHP_FUNCTION(strpos)
 {
-       zval *needle;
-       zend_string *haystack;
+       zend_string *haystack, *needle;
        const char *found = NULL;
-       char  needle_char[2];
-       zend_long  offset = 0;
+       zend_long offset = 0;
 
        ZEND_PARSE_PARAMETERS_START(2, 3)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(needle)
+               Z_PARAM_STR(needle)
                Z_PARAM_OPTIONAL
                Z_PARAM_LONG(offset)
        ZEND_PARSE_PARAMETERS_END();
@@ -1980,32 +1918,15 @@ PHP_FUNCTION(strpos)
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_P(needle) == IS_STRING) {
-               if (!Z_STRLEN_P(needle)) {
-                       php_error_docref(NULL, E_WARNING, "Empty needle");
-                       RETURN_FALSE;
-               }
-
-               found = (char*)php_memnstr(ZSTR_VAL(haystack) + offset,
-                                       Z_STRVAL_P(needle),
-                                       Z_STRLEN_P(needle),
-                                       ZSTR_VAL(haystack) + ZSTR_LEN(haystack));
-       } else {
-               if (php_needle_char(needle, needle_char) != SUCCESS) {
-                       RETURN_FALSE;
-               }
-               needle_char[1] = 0;
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               found = (char*)php_memnstr(ZSTR_VAL(haystack) + offset,
-                                                       needle_char,
-                                                       1,
-                                   ZSTR_VAL(haystack) + ZSTR_LEN(haystack));
+       if (!ZSTR_LEN(needle)) {
+               php_error_docref(NULL, E_WARNING, "Empty needle");
+               RETURN_FALSE;
        }
 
+       found = (char*)php_memnstr(ZSTR_VAL(haystack) + offset,
+                                               ZSTR_VAL(needle), ZSTR_LEN(needle),
+                                               ZSTR_VAL(haystack) + ZSTR_LEN(haystack));
+
        if (found) {
                RETURN_LONG(found - ZSTR_VAL(haystack));
        } else {
@@ -2019,15 +1940,13 @@ PHP_FUNCTION(strpos)
 PHP_FUNCTION(stripos)
 {
        const char *found = NULL;
-       zend_string *haystack;
+       zend_string *haystack, *needle;
        zend_long offset = 0;
-       char needle_char[2];
-       zval *needle;
        zend_string *needle_dup = NULL, *haystack_dup;
 
        ZEND_PARSE_PARAMETERS_START(2, 3)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(needle)
+               Z_PARAM_STR(needle)
                Z_PARAM_OPTIONAL
                Z_PARAM_LONG(offset)
        ZEND_PARSE_PARAMETERS_END();
@@ -2044,33 +1963,14 @@ PHP_FUNCTION(stripos)
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_P(needle) == IS_STRING) {
-               if (Z_STRLEN_P(needle) == 0 || Z_STRLEN_P(needle) > ZSTR_LEN(haystack)) {
-                       RETURN_FALSE;
-               }
-
-               haystack_dup = php_string_tolower(haystack);
-               needle_dup = php_string_tolower(Z_STR_P(needle));
-               found = (char*)php_memnstr(ZSTR_VAL(haystack_dup) + offset,
-                               ZSTR_VAL(needle_dup), ZSTR_LEN(needle_dup), ZSTR_VAL(haystack_dup) + ZSTR_LEN(haystack));
-       } else {
-               if (php_needle_char(needle, needle_char) != SUCCESS) {
-                       RETURN_FALSE;
-               }
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               haystack_dup = php_string_tolower(haystack);
-               needle_char[0] = tolower(needle_char[0]);
-               needle_char[1] = '\0';
-               found = (char*)php_memnstr(ZSTR_VAL(haystack_dup) + offset,
-                                                       needle_char,
-                                                       sizeof(needle_char) - 1,
-                                                       ZSTR_VAL(haystack_dup) + ZSTR_LEN(haystack));
+       if (ZSTR_LEN(needle) == 0 || ZSTR_LEN(needle) > ZSTR_LEN(haystack)) {
+               RETURN_FALSE;
        }
 
+       haystack_dup = php_string_tolower(haystack);
+       needle_dup = php_string_tolower(needle);
+       found = (char*)php_memnstr(ZSTR_VAL(haystack_dup) + offset,
+                       ZSTR_VAL(needle_dup), ZSTR_LEN(needle_dup), ZSTR_VAL(haystack_dup) + ZSTR_LEN(haystack));
 
        if (found) {
                RETVAL_LONG(found - ZSTR_VAL(haystack_dup));
@@ -2089,38 +1989,20 @@ PHP_FUNCTION(stripos)
    Finds position of last occurrence of a string within another string */
 PHP_FUNCTION(strrpos)
 {
-       zval *zneedle;
        zend_string *haystack;
+       char *needle;
        size_t needle_len;
        zend_long offset = 0;
-       char ord_needle[2];
-       const char *p, *e, *found, *needle;
+       const char *p, *e, *found;
 
        ZEND_PARSE_PARAMETERS_START(2, 3)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(zneedle)
+               Z_PARAM_STRING(needle, needle_len)
                Z_PARAM_OPTIONAL
                Z_PARAM_LONG(offset)
        ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
 
-       if (Z_TYPE_P(zneedle) == IS_STRING) {
-               needle = Z_STRVAL_P(zneedle);
-               needle_len = Z_STRLEN_P(zneedle);
-       } else {
-               if (php_needle_char(zneedle, ord_needle) != SUCCESS) {
-                       RETURN_FALSE;
-               }
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               ord_needle[1] = '\0';
-               needle = ord_needle;
-               needle_len = 1;
-       }
-
-       if ((ZSTR_LEN(haystack) == 0) || (needle_len == 0)) {
+       if (ZSTR_LEN(haystack) == 0 || needle_len == 0) {
                RETURN_FALSE;
        }
 
@@ -2156,49 +2038,29 @@ PHP_FUNCTION(strrpos)
    Finds position of last occurrence of a string within another string */
 PHP_FUNCTION(strripos)
 {
-       zval *zneedle;
        zend_string *needle;
        zend_string *haystack;
        zend_long offset = 0;
        const char *p, *e, *found;
-       zend_string *needle_dup, *haystack_dup, *ord_needle = NULL;
-       ALLOCA_FLAG(use_heap);
+       zend_string *needle_dup, *haystack_dup;
 
        ZEND_PARSE_PARAMETERS_START(2, 3)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(zneedle)
+               Z_PARAM_STR(needle)
                Z_PARAM_OPTIONAL
                Z_PARAM_LONG(offset)
        ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
 
-       ZSTR_ALLOCA_ALLOC(ord_needle, 1, use_heap);
-       if (Z_TYPE_P(zneedle) == IS_STRING) {
-               needle = Z_STR_P(zneedle);
-       } else {
-               if (php_needle_char(zneedle, ZSTR_VAL(ord_needle)) != SUCCESS) {
-                       ZSTR_ALLOCA_FREE(ord_needle, use_heap);
-                       RETURN_FALSE;
-               }
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               ZSTR_VAL(ord_needle)[1] = '\0';
-               needle = ord_needle;
-       }
-
-       if ((ZSTR_LEN(haystack) == 0) || (ZSTR_LEN(needle) == 0)) {
-               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
+       if (ZSTR_LEN(haystack) == 0 || ZSTR_LEN(needle) == 0) {
                RETURN_FALSE;
        }
 
        if (ZSTR_LEN(needle) == 1) {
                /* Single character search can shortcut memcmps
                   Can also avoid tolower emallocs */
+               char lowered;
                if (offset >= 0) {
                        if ((size_t)offset > ZSTR_LEN(haystack)) {
-                               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
                                php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
                                RETURN_FALSE;
                        }
@@ -2207,22 +2069,19 @@ PHP_FUNCTION(strripos)
                } else {
                        p = ZSTR_VAL(haystack);
                        if (offset < -INT_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) {
-                               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
                                php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
                                RETURN_FALSE;
                        }
                        e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack) + (size_t)offset;
                }
                /* Borrow that ord_needle buffer to avoid repeatedly tolower()ing needle */
-               *ZSTR_VAL(ord_needle) = tolower(*ZSTR_VAL(needle));
+               lowered = tolower(*ZSTR_VAL(needle));
                while (e >= p) {
-                       if (tolower(*e) == *ZSTR_VAL(ord_needle)) {
-                               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
+                       if (tolower(*e) == lowered) {
                                RETURN_LONG(e - p + (offset > 0 ? offset : 0));
                        }
                        e--;
                }
-               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
                RETURN_FALSE;
        }
 
@@ -2230,7 +2089,6 @@ PHP_FUNCTION(strripos)
        if (offset >= 0) {
                if ((size_t)offset > ZSTR_LEN(haystack)) {
                        zend_string_release_ex(haystack_dup, 0);
-                       ZSTR_ALLOCA_FREE(ord_needle, use_heap);
                        php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
                        RETURN_FALSE;
                }
@@ -2239,7 +2097,6 @@ PHP_FUNCTION(strripos)
        } else {
                if (offset < -INT_MAX || (size_t)(-offset) > ZSTR_LEN(haystack)) {
                        zend_string_release_ex(haystack_dup, 0);
-                       ZSTR_ALLOCA_FREE(ord_needle, use_heap);
                        php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
                        RETURN_FALSE;
                }
@@ -2256,11 +2113,9 @@ PHP_FUNCTION(strripos)
                RETVAL_LONG(found - ZSTR_VAL(haystack_dup));
                zend_string_release_ex(needle_dup, 0);
                zend_string_release_ex(haystack_dup, 0);
-               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
        } else {
                zend_string_release_ex(needle_dup, 0);
                zend_string_release_ex(haystack_dup, 0);
-               ZSTR_ALLOCA_FREE(ord_needle, use_heap);
                RETURN_FALSE;
        }
 }
@@ -2270,31 +2125,16 @@ PHP_FUNCTION(strripos)
    Finds the last occurrence of a character in a string within another */
 PHP_FUNCTION(strrchr)
 {
-       zval *needle;
-       zend_string *haystack;
+       zend_string *haystack, *needle;
        const char *found = NULL;
        zend_long found_offset;
 
        ZEND_PARSE_PARAMETERS_START(2, 2)
                Z_PARAM_STR(haystack)
-               Z_PARAM_ZVAL(needle)
+               Z_PARAM_STR(needle)
        ZEND_PARSE_PARAMETERS_END();
 
-       if (Z_TYPE_P(needle) == IS_STRING) {
-               found = zend_memrchr(ZSTR_VAL(haystack), *Z_STRVAL_P(needle), ZSTR_LEN(haystack));
-       } else {
-               char needle_chr;
-               if (php_needle_char(needle, &needle_chr) != SUCCESS) {
-                       RETURN_FALSE;
-               }
-
-               php_error_docref(NULL, E_DEPRECATED,
-                       "Non-string needles will be interpreted as strings in the future. " \
-                       "Use an explicit chr() call to preserve the current behavior");
-
-               found = zend_memrchr(ZSTR_VAL(haystack),  needle_chr, ZSTR_LEN(haystack));
-       }
-
+       found = zend_memrchr(ZSTR_VAL(haystack), *ZSTR_VAL(needle), ZSTR_LEN(haystack));
        if (found) {
                found_offset = found - ZSTR_VAL(haystack);
                RETURN_STRINGL(found, ZSTR_LEN(haystack) - found_offset);
index 057b8ca494d79d84b9544ebea14325501000382c..4c3c5a7fccc219eeecd59c8bb5ab4e3f71341699 100644 (file)
@@ -28,7 +28,7 @@ stripos() function test
 
        echo "Done\n";
 ?>
---EXPECTF--
+--EXPECT--
 int(0)
 int(5)
 int(5)
@@ -45,23 +45,11 @@ int(0)
 bool(false)
 bool(false)
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
+int(0)
 int(1)
 Done
index a3fc324dd768508636348b228af60f907b7cf6fd..53d6be65e7e0ca05b3cb30163bd63cdf80c31917 100644 (file)
@@ -81,7 +81,7 @@ for($index=0; $index<count($needle); $index++) {
 }
 echo "*** Done ***";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing stripos() function: with double quoted strings ***
 -- Iteration 1 --
 int(2)
@@ -117,32 +117,16 @@ int(9)
 int(8)
 bool(false)
 -- Iteration 12 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-int(8)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 13 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-int(8)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 14 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-int(8)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 15 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-int(8)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 16 --
 bool(false)
index 81b8f5adb1b223187ca8a2b6d7863e403747fff1..81d3b35a2079597d8082cf19ff71dac85aaf659f 100644 (file)
@@ -95,101 +95,71 @@ echo "*** Done ***";
 *** Testing stripos() function with unexpected values for needle ***
 
 -- Iteration 1 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(7)
 
 -- Iteration 2 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(9)
 
 -- Iteration 3 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 4 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 5 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(16)
 
 -- Iteration 6 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(21)
 
 -- Iteration 7 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 8 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 9 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(17)
 
 -- Iteration 10 --
 
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
+NULL
 
 -- Iteration 11 --
 
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
+NULL
 
 -- Iteration 12 --
 
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
+NULL
 
 -- Iteration 13 --
 
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
+NULL
 
 -- Iteration 14 --
 
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stripos() expects parameter 2 to be string, array given in %s on line %d
+NULL
 
 -- Iteration 15 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(9)
 
 -- Iteration 16 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 17 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(9)
 
 -- Iteration 18 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 19 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(64)
 
 -- Iteration 20 --
 bool(false)
@@ -198,27 +168,19 @@ bool(false)
 bool(false)
 
 -- Iteration 22 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 23 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 24 --
 
-Warning: stripos(): needle is not a string or an integer in %s on line %d
-%s
+Warning: stripos() expects parameter 2 to be string, resource given in %s on line %d
+NULL
 
 -- Iteration 25 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 
 -- Iteration 26 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 *** Done ***
index b4b83a16415b171fee0206ebca3b77123f0d44c1..1f79b61d1aa5edbb358c58fb865d5febe052362e 100644 (file)
@@ -91,67 +91,31 @@ echo "*** Done ***";
 --EXPECTF--
 *** Testing stripos() function with unexpected values for haystack and needle ***
 -- Iteration 1 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 2 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 3 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 4 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 5 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 6 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 7 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 8 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 9 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 10 --
 
@@ -189,11 +153,7 @@ NULL
 Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
 NULL
 -- Iteration 15 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 16 --
 bool(false)
@@ -201,11 +161,7 @@ bool(false)
 Warning: stripos(): Offset not contained in string in %s on line %d
 bool(false)
 -- Iteration 17 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 18 --
 bool(false)
@@ -213,15 +169,7 @@ bool(false)
 Warning: stripos(): Offset not contained in string in %s on line %d
 bool(false)
 -- Iteration 19 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+int(0)
 bool(false)
 -- Iteration 20 --
 bool(false)
index f8d4f029fe4cc4d283d233b9682c7a7874b5a3a4..4d4b6396b9b51563970197408fe3164f5f05e087 100644 (file)
@@ -91,12 +91,8 @@ echo "*** Done ***";
 --EXPECTF--
 *** Testing stripos() function with unexpected values for haystack, needle & offset ***
 -- Iteration 1 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(0)
 -- Iteration 2 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 3 --
 
@@ -119,13 +115,9 @@ bool(false)
 Warning: stripos(): Offset not contained in string in %s on line %d
 bool(false)
 -- Iteration 8 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(0)
 -- Iteration 9 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
+int(0)
 -- Iteration 10 --
 
 Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
@@ -147,14 +139,10 @@ NULL
 Warning: stripos() expects parameter 1 to be string, array given in %s on line %d
 NULL
 -- Iteration 15 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 16 --
 bool(false)
 -- Iteration 17 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 18 --
 bool(false)
index bb77d1becb7c272cc4586f3a677570b0ede05087..0f4c887869856d23b0a24be45585e467220a94d1 100644 (file)
@@ -83,7 +83,7 @@ for($index=0; $index<count($needle); $index++) {
 }
 echo "*** Done ***";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing stripos() function: with single quoted strings ***
 -- Iteration 1 --
 int(2)
@@ -119,32 +119,16 @@ bool(false)
 int(10)
 int(10)
 -- Iteration 12 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 13 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 14 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 15 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 16 --
 bool(false)
@@ -234,11 +218,7 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 45 --
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-int(26)
-
-Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 46 --
 int(0)
index 8fca54b082e4bfc6918d486c94050ebc837b4046..a0f0cc3497983d5557511c592ce7d29af0ab57c5 100644 (file)
@@ -25,8 +25,8 @@ NULL
 Warning: stristr() expects parameter 1 to be string, array given in %s on line %d
 NULL
 
-Warning: stristr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 
 Warning: stristr() expects parameter 1 to be string, array given in %s on line %d
 NULL
index b899b4739d9c7c869d4ca430ff93dde0187a91f0..ae2c8e93cf0033e4c5188b9fb4661ab1757efc92 100644 (file)
@@ -16,14 +16,10 @@ var_dump(stristr($email, 97));
 var_dump(stristr($email, 97, 1));
 
 ?>
---EXPECTF--
+--EXPECT--
 string(7) "cCdEfGh"
 string(2) "Ab"
 string(5) "eEfGh"
 string(4) "AbCd"
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-string(11) "azAbCdeEfGh"
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-string(1) "w"
+bool(false)
+bool(false)
index 4a0b62f261e64e8ce0adf052279527ebdb1a9bcd..8ca09db66c2ce7a4603da946896cd13874bd12e3 100644 (file)
@@ -83,85 +83,63 @@ fclose($file_handle);  //closing the file handle
 --EXPECTF--
 *** Testing stristr() function: with unexpected inputs for 'needle' argument ***
 -- Iteration 1 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 2 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 3 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 4 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 5 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 6 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 7 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior 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)
+Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 9 --
 
-Warning: stristr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 10 --
 
-Warning: stristr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stristr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 11 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 12 --
 
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+Warning: stristr(): Empty needle in %s on line %d
 bool(false)
 -- Iteration 13 --
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 14 --
 
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+Warning: stristr(): Empty needle in %s on line %d
 bool(false)
 -- Iteration 15 --
 
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+Warning: stristr(): Empty needle in %s on line %d
 bool(false)
 -- Iteration 16 --
 
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+Warning: stristr(): Empty needle in %s on line %d
 bool(false)
 -- Iteration 17 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
 bool(false)
 -- Iteration 18 --
 
-Warning: stristr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: stristr() expects parameter 2 to be string, resource given in %s on line %d
+NULL
 -- Iteration 19 --
 
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+Warning: stristr(): Empty needle in %s on line %d
 bool(false)
 -- Iteration 20 --
 
-Deprecated: stristr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+Warning: stristr(): Empty needle in %s on line %d
 bool(false)
 ===DONE===
index 578539804dce58df0af6d42611b352246d325779..a4c3a9c7813a3e753fba312b330acf398367eaeb 100644 (file)
Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ
index fd045c64d37fec7d0f437b20426ca375a6f1ad17..76cf8e59ef6ca030637d2f2c9a404296aad2c93e 100644 (file)
@@ -9,10 +9,7 @@ var_dump(strpos("foo bar", 111));
 // string("11") is contained
 var_dump(strpos("foo 11", "11"));
 ?>
---EXPECTF--
-Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
+--EXPECT--
+int(4)
 bool(false)
-
-Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-int(1)
 int(4)
index 5043128945e3160d9cfd431558895322dbbf969b..a75dd96bbf6f64cccfabe85c40c10382ec6899b0 100644 (file)
Binary files a/ext/standard/tests/strings/strrchr_variation1.phpt and b/ext/standard/tests/strings/strrchr_variation1.phpt differ
index 3b06b20be123bd7cfeeee5fe3e2c04147325f9de..478ac80300333ec367122896e39e639a2333e2a8 100644 (file)
@@ -132,105 +132,67 @@ echo "*** Done ***";
 --EXPECTF--
 *** Testing strrchr() function with unexpected inputs for needle ***
 -- Iteration 1 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(1) "0"
 -- Iteration 2 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(1) "1"
 -- Iteration 3 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 4 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(2) "-2"
 -- Iteration 5 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(4) "10.5"
 -- Iteration 6 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(5) "-10.5"
 -- Iteration 7 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(2) "10"
 -- Iteration 8 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(2) "10"
 -- Iteration 9 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 10 --
 
-Warning: strrchr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 11 --
 
-Warning: strrchr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 12 --
 
-Warning: strrchr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 13 --
 
-Warning: strrchr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 14 --
 
-Warning: strrchr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d
+NULL
 -- Iteration 15 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 16 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 17 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 18 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 19 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 20 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 21 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(6) "object"
 -- Iteration 22 --
 bool(false)
 -- Iteration 23 --
 bool(false)
 -- Iteration 24 --
 
-Warning: strrchr(): needle is not a string or an integer in %s on line %d
-bool(false)
+Warning: strrchr() expects parameter 2 to be string, resource given in %s on line %d
+NULL
 -- Iteration 25 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 26 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 *** Done ***
index 108ba2e0f2ba0ff2e889238e8f3de2324a8a9812..92a9c07eee26f570edf8f77e5f9597cea2fd13a0 100644 (file)
@@ -91,41 +91,23 @@ echo "*** Done ***";
 --EXPECTF--
 *** Testing strrchr() function: with unexpected inputs for haystack and needle ***
 -- Iteration 1 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(1) "0"
 -- Iteration 2 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(1) "1"
 -- Iteration 3 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(5) "12345"
 -- Iteration 4 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(5) "-2345"
 -- Iteration 5 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(4) "10.5"
 -- Iteration 6 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(5) "-10.5"
 -- Iteration 7 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(10) "1234567000"
 -- Iteration 8 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(4) "1E-9"
 -- Iteration 9 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(3) "0.5"
 -- Iteration 10 --
 
 Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
@@ -147,49 +129,29 @@ NULL
 Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d
 NULL
 -- Iteration 15 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(1) "1"
 -- Iteration 16 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 17 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(1) "1"
 -- Iteration 18 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 19 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+string(6) "object"
 -- Iteration 20 --
 bool(false)
 -- Iteration 21 --
 bool(false)
 -- Iteration 22 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 23 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 24 --
 
 Warning: strrchr() expects parameter 1 to be string, resource given in %s on line %d
 NULL
 -- Iteration 25 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 26 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 *** Done ***
index 730811ea47295c8d749e2e240feabfdd0bbb8a51..a17902604a5c71190484e06695042b6367f06a9e 100644 (file)
Binary files a/ext/standard/tests/strings/strrchr_variation12.phpt and b/ext/standard/tests/strings/strrchr_variation12.phpt differ
index ddce2c2ccbb33f16f45d00725f9f8d90158e2545..2ff6720fb9005883af5ef82147138442e2b92e83 100644 (file)
@@ -117,23 +117,15 @@ bool(false)
 string(5) "\101 "
 
 -- Iteration 12 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 
 -- Iteration 13 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 
 -- Iteration 14 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 
 -- Iteration 15 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 
 -- Iteration 16 --
@@ -221,9 +213,7 @@ bool(false)
 string(7) "4 \101 "
 
 -- Iteration 44 --
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
-string(37) "*+-./:;<=>?@hello123456he \x234 \101 "
+string(7) "4 \101 "
 
 -- Iteration 45 --
 string(63) "Hello,\t\n\0\n  $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 "
index 6b49b698f437b8e14b291ea12352e861e15e7492..31a727ed6fbebfc55d45c8d350116f02fede922d 100644 (file)
@@ -30,15 +30,11 @@ foreach($needles as $needle) {
 }
 echo "*** Done ***";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing strrchr() function: with heredoc strings ***
 bool(false)
 bool(false)
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 bool(false)
 bool(false)
index 70a9534ebd43b6a329e6cb053bb16b38e3a07207..b5d09d79461f8c5ab4a33a97092c448c4196a7f5 100644 (file)
@@ -31,16 +31,12 @@ bool(false)
 Warning: strripos() expects parameter 1 to be string, array given in %s on line %d
 bool(false)
 
-Deprecated: strripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
 Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
 bool(false)
 
 Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
 bool(false)
 
-Deprecated: strripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
 Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
 bool(false)
 
index 59d7a646863a6e21dbab2652db2f95295990d808..ce396695aff2cba0f98a6729f825a5d87b0e27dd 100644 (file)
@@ -74,7 +74,7 @@ foreach ($needles as $needle) {
 }
 ?>
 ===DONE===
---EXPECTF--
+--EXPECT--
 *** Testing strripos() function: with double quoted strings ***
 -- Iteration 1 --
 int(28)
@@ -132,57 +132,25 @@ int(8)
 bool(false)
 int(8)
 -- Iteration 12 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
+bool(false)
+bool(false)
+bool(false)
 -- Iteration 13 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
+bool(false)
+bool(false)
+bool(false)
 -- Iteration 14 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
+bool(false)
+bool(false)
+bool(false)
 -- Iteration 15 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
+bool(false)
+bool(false)
+bool(false)
 -- Iteration 16 --
 bool(false)
 bool(false)
index 7b47b787be9ccaa04c84ce5c8b61ce5ea02f8eed..3800c321551b9bb6f5d32bee1f230adf29be2586 100644 (file)
@@ -75,7 +75,7 @@ foreach ($needles as $needle) {
 }
 ?>
 ===DONE===
---EXPECTF--
+--EXPECT--
 *** Testing strripos() function: with single quoted strings ***
 -- Iteration 1 --
 int(32)
@@ -133,56 +133,24 @@ int(10)
 bool(false)
 int(10)
 -- Iteration 12 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 13 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 14 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 15 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 16 --
 bool(false)
@@ -280,18 +248,10 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 35 --
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(23)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(23)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(23)
-
-Deprecated: strripos(): Non-string needles will be interpreted as strings in %s on line %d
-int(23)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
 -- Iteration 36 --
 int(0)
 bool(false)
index 9ef4f42d18703191daad4a61a8c5edcf5081c666..1399b6098573e3e96cd01ad1391c4c9918a4d5ce 100644 (file)
@@ -27,16 +27,12 @@ bool(false)
 Warning: strrpos() expects parameter 3 to be int, float given in %s on line %d
 bool(false)
 
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
 Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
 bool(false)
 
 Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
 bool(false)
 
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
 Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
 bool(false)
 
index fd236d04d4e379c6c2b2e7b3e5ffd34c01a1ddc4..4fc480face59926d9b24b2d93d0e84dd356de7b5 100644 (file)
@@ -72,7 +72,7 @@ for($index=0; $index<count($needle); $index++) {
 }
 echo "*** Done ***";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing strrpos() function: with double quoted strings ***
 -- Iteration 1 --
 int(28)
@@ -108,32 +108,16 @@ int(9)
 int(8)
 bool(false)
 -- Iteration 12 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 13 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 14 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 15 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-int(8)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 16 --
 bool(false)
index b9b24b9cb1be0ad8c95a699b4512e2d728d0d082..b374e7f9f6ce08f545b46ad965ca86b90b2a5714 100644 (file)
@@ -94,105 +94,67 @@ echo "*** Done ***";
 --EXPECTF--
 *** Testing strrpos() function with unexpected values for needle ***
 -- Iteration 1 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(42)
 -- Iteration 2 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(41)
 -- Iteration 3 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 4 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 5 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(27)
 -- Iteration 6 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(21)
 -- Iteration 7 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 8 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 9 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(28)
 -- Iteration 10 --
 
-Warning: strrpos(): needle is not a string or an integer in %s on line %d
+Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d
 bool(false)
 -- Iteration 11 --
 
-Warning: strrpos(): needle is not a string or an integer in %s on line %d
+Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d
 bool(false)
 -- Iteration 12 --
 
-Warning: strrpos(): needle is not a string or an integer in %s on line %d
+Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d
 bool(false)
 -- Iteration 13 --
 
-Warning: strrpos(): needle is not a string or an integer in %s on line %d
+Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d
 bool(false)
 -- Iteration 14 --
 
-Warning: strrpos(): needle is not a string or an integer in %s on line %d
+Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d
 bool(false)
 -- Iteration 15 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(41)
 -- Iteration 16 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 17 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(41)
 -- Iteration 18 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 19 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
+int(64)
 -- Iteration 20 --
 bool(false)
 -- Iteration 21 --
 bool(false)
 -- Iteration 22 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 23 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 24 --
 
-Warning: strrpos(): needle is not a string or an integer in %s on line %d
+Warning: strrpos() expects parameter 2 to be string, resource given in %s on line %d
 bool(false)
 -- Iteration 25 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 26 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 *** Done ***
index 94c1b9d96dbb497fcafa8f21f4d41e28192e6bb2..f628427f08139594ef6953865b24dde602838615 100644 (file)
@@ -91,67 +91,31 @@ echo "*** Done ***";
 --EXPECTF--
 *** Testing strrpos() function with unexpected values for haystack and needle ***
 -- Iteration 1 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 2 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 3 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 4 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 5 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 6 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 7 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 8 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 9 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 10 --
 
@@ -189,43 +153,19 @@ bool(false)
 Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d
 bool(false)
 -- Iteration 15 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 16 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 17 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 18 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 19 --
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-bool(false)
-
-Notice: Object of class sample could not be converted to int in %s on line %d
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+int(0)
 bool(false)
 -- Iteration 20 --
 bool(false)
@@ -234,18 +174,10 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 22 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 23 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 24 --
 
@@ -255,17 +187,9 @@ bool(false)
 Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d
 bool(false)
 -- Iteration 25 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 26 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 *** Done ***
diff --git a/ext/standard/tests/strings/strrpos_variation15.phpt b/ext/standard/tests/strings/strrpos_variation15.phpt
deleted file mode 100644 (file)
index 798a687..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
---TEST--
-Test strrpos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments
---SKIPIF--
-<?php if (PHP_INT_SIZE !== 4) die("skip this test is for 32-bit only");
---FILE--
-<?php
-/* Prototype  : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
-/* Test strrpos() function with unexpected inputs for 'haystack', 'needle' & 'offset' arguments */
-
-echo "*** Testing strrpos() function: with unexpected values for haystack, needle & offset ***\n";
-
-// get an unset variable
-$unset_var = 'string_val';
-unset($unset_var);
-
-// defining a class
-class sample  {
-  public function __toString() {
-    return "object";
-  }
-}
-
-//getting the resource
-$file_handle = fopen(__FILE__, "r");
-
-// array with different values
-$values =  array (
-
-  // integer values
-  0,
-  1,
-  12345,
-  -2345,
-
-  // float values
-  10.5,
-  -10.5,
-  10.5e10,
-  10.6E-10,
-  .5,
-
-  // array values
-  array(),
-  array(0),
-  array(1),
-  array(1, 2),
-  array('color' => 'red', 'item' => 'pen'),
-
-  // boolean values
-  true,
-  false,
-  TRUE,
-  FALSE,
-
-  // objects
-  new sample(),
-
-  // empty string
-  "",
-  '',
-
-  // null values
-  NULL,
-  null,
-
-  //resource
-  $file_handle,
-
-  // undefined variable
-  @$undefined_var,
-
-  // unset variable
-  @$unset_var
-);
-
-
-// loop through each element of the array and check the working of strrpos()
-$counter = 1;
-for($index = 0; $index < count($values); $index ++) {
-  echo "-- Iteration $counter --\n";
-  var_dump( strrpos($values[$index], $values[$index], $values[$index]) );
-  $counter ++;
-}
-
-echo "*** Done ***";
-?>
---EXPECTF--
-*** Testing strrpos() function: with unexpected values for haystack, needle & offset ***
--- Iteration 1 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 2 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 3 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
-bool(false)
--- Iteration 4 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
-bool(false)
--- Iteration 5 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
-bool(false)
--- Iteration 6 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-
-Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
-bool(false)
--- Iteration 7 --
-
-Warning: strrpos() expects parameter 3 to be int, float given in %s on line %d
-bool(false)
--- Iteration 8 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 9 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 10 --
-
-Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
--- Iteration 11 --
-
-Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
--- Iteration 12 --
-
-Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
--- Iteration 13 --
-
-Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
--- Iteration 14 --
-
-Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
--- Iteration 15 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 16 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 17 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 18 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 19 --
-
-Warning: strrpos() expects parameter 3 to be int, object given in %s on line %d
-bool(false)
--- Iteration 20 --
-
-Warning: strrpos() expects parameter 3 to be int, string given in %s on line %d
-bool(false)
--- Iteration 21 --
-
-Warning: strrpos() expects parameter 3 to be int, string given in %s on line %d
-bool(false)
--- Iteration 22 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 23 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 24 --
-
-Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d
-bool(false)
--- Iteration 25 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
--- Iteration 26 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in %s on line %d
-bool(false)
-*** Done ***
index 9c0a3207852bf3ea700751540855f407b6c850da..af5c9e349d71b83218709530c17add218dc1408a 100644 (file)
@@ -73,7 +73,7 @@ for($index=0; $index<count($needle); $index++) {
 }
 echo "*** Done ***";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing strrpos() function: with single quoted strings ***
 -- Iteration 1 --
 int(32)
@@ -109,32 +109,16 @@ bool(false)
 int(10)
 int(10)
 -- Iteration 12 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 13 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 14 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 15 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 -- Iteration 16 --
 bool(false)
@@ -194,11 +178,7 @@ bool(false)
 bool(false)
 bool(false)
 -- Iteration 35 --
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
-int(23)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
+bool(false)
 bool(false)
 -- Iteration 36 --
 int(0)
index 54db4b372ead6db4bed6a19d309b12cdf5644486..c0546c74f8ca42a77504fd975e286dd88eb450f5 100644 (file)
@@ -22,15 +22,11 @@ var_dump( strrpos($empty_string, NULL) );
 
 echo "*** Done ***";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing strrpos() function: with heredoc strings ***
 -- With empty heredoc string --
 bool(false)
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
-
-Deprecated: strrpos(): Non-string needles will be interpreted as strings in %s on line %d
 bool(false)
 *** Done ***
index 2908de7a27e9604a010f8a4e64d667454f2d359c..cc3b7c545316067fe7a00ddef7b4f389a822d7e8 100644 (file)
Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ
index bf1fb67711722b5f282153088664964da6418fce..6d0a9d12b9e0f5b3e079145e94947759e68a4159 100644 (file)
@@ -3,8 +3,6 @@ String functions
 --FILE--
 <?php
 
-error_reporting(0);
-
 echo "Testing strtok: ";
 
 $str = "testing 1/2\\3";
@@ -26,7 +24,7 @@ if ($tok1 != "testing") {
 
 echo "Testing strstr: ";
 $test = "This is a test";
-$found1 = strstr($test, 32);
+$found1 = strstr($test, chr(32));
 $found2 = strstr($test, "a ");
 if ($found1 != " is a test") {
        echo("failed 1\n");
@@ -39,7 +37,7 @@ if ($found1 != " is a test") {
 echo "Testing strrchr: ";
 $test = "fola fola blakken";
 $found1 = strrchr($test, "b");
-$found2 = strrchr($test, 102);
+$found2 = strrchr($test, chr(102));
 if ($found1 != "blakken") {
        echo("failed 1\n");
 } elseif ($found2 != "fola blakken") {