]> granicus.if.org Git - php/commitdiff
substr_replace() cannot return false
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 22 Sep 2020 07:59:25 +0000 (09:59 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 22 Sep 2020 07:59:35 +0000 (09:59 +0200)
ext/opcache/Optimizer/zend_func_info.c
ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h

index 42dd8c691408035686f5cd6dcf78139330fe4827..87ec2e1ffa9eb30db9bcf7cc8c649d76b4cb2417 100644 (file)
@@ -160,7 +160,7 @@ static const func_info_t func_infos[] = {
        F1("str_word_count",               MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
        F1("str_split",                    MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
        F1("strpbrk",                      MAY_BE_FALSE | MAY_BE_STRING),
-       FN("substr_replace",               MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
+       FN("substr_replace",               MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
        F1("quotemeta",                    MAY_BE_STRING),
        F1("ucwords",                      MAY_BE_STRING),
        F1("addcslashes",                  MAY_BE_STRING),
index 33357352e8f6174f682483de244710d7c777dcd7..1ef91e462376885de2f619b3d723831136530db3 100755 (executable)
@@ -609,7 +609,7 @@ function chunk_split(string $str, int $chunklen = 76, string $ending = "\r\n"):
 
 function substr(string $str, int $start, ?int $length = null): string|false {}
 
-function substr_replace(array|string $str, array|string $replace, array|int $start, array|int|null $length = null): string|array|false {}
+function substr_replace(array|string $str, array|string $replace, array|int $start, array|int|null $length = null): string|array {}
 
 function quotemeta(string $str): string {}
 
index 5919da6b8ea52ddc264f0a77a88c847fc0fddd8d..b51a11bafa1e229a0e84c79edbd9c0e9d254f425 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3dc6fc3e3cd4bb5442bfd50c34463b3834bba289 */
+ * Stub hash: e71146872a1913d2cef37132c8b27ce1dc9b1a39 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
        ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
@@ -930,7 +930,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr, 0, 2, MAY_BE_STRING|MAY_
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY)
        ZEND_ARG_TYPE_MASK(0, str, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
        ZEND_ARG_TYPE_MASK(0, replace, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
        ZEND_ARG_TYPE_MASK(0, start, MAY_BE_ARRAY|MAY_BE_LONG, NULL)