Skip to content

Commit ade57e6

Browse files
committed
substr_replace() cannot return false
1 parent 8f3a38d commit ade57e6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static const func_info_t func_infos[] = {
160160
F1("str_word_count", MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
161161
F1("str_split", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
162162
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
163-
FN("substr_replace", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
163+
FN("substr_replace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
164164
F1("quotemeta", MAY_BE_STRING),
165165
F1("ucwords", MAY_BE_STRING),
166166
F1("addcslashes", MAY_BE_STRING),

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ function chunk_split(string $str, int $chunklen = 76, string $ending = "\r\n"):
609609

610610
function substr(string $str, int $start, ?int $length = null): string|false {}
611611

612-
function substr_replace(array|string $str, array|string $replace, array|int $start, array|int|null $length = null): string|array|false {}
612+
function substr_replace(array|string $str, array|string $replace, array|int $start, array|int|null $length = null): string|array {}
613613

614614
function quotemeta(string $str): string {}
615615

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3dc6fc3e3cd4bb5442bfd50c34463b3834bba289 */
2+
* Stub hash: e71146872a1913d2cef37132c8b27ce1dc9b1a39 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
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_
930930
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null")
931931
ZEND_END_ARG_INFO()
932932

933-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE)
933+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY)
934934
ZEND_ARG_TYPE_MASK(0, str, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
935935
ZEND_ARG_TYPE_MASK(0, replace, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
936936
ZEND_ARG_TYPE_MASK(0, start, MAY_BE_ARRAY|MAY_BE_LONG, NULL)

0 commit comments

Comments
 (0)