com php-src: hebrev/hebrevc: Don't return false for empty string: ext/opcache/Optimizer/zend_func_info.c ext/standard/str ing.c
| From: | Nikita Popov | Date: | Tue, 28 May 2019 11:12:38 +0000 |
| Subject: | com php-src: hebrev/hebrevc: Don't return false for empty string: ext/opcache/Optimizer/zend_func_info.c ext/standard/str ing.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106391@lists.php.net to get a copy of this message | ||
Commit: 4da316d18991ff4dbe0a7315045f7928d66a4381
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 28 May 2019 13:07:03 +0200
Parents: 0d79c70cf3c10f60a2e8fbfd68903d8716b7b43c
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4da316d18991ff4dbe0a7315045f7928d66a4381
Log:
hebrev/hebrevc: Don't return false for empty string
There is nothing special about the empty string in this context,
we should pass it through unchanged.
Changed paths:
M ext/opcache/Optimizer/zend_func_info.c
M ext/standard/string.c
Diff:
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index dfb4451..ae33da0 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -189,8 +189,8 @@ static const func_info_t func_infos[] = {
F0("strrpos", MAY_BE_FALSE | MAY_BE_LONG),
F0("strripos", MAY_BE_FALSE | MAY_BE_LONG),
F1("strrev", MAY_BE_STRING),
- F1("hebrev", MAY_BE_FALSE | MAY_BE_STRING),
- F1("hebrevc", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("hebrev", MAY_BE_STRING),
+ F1("hebrevc", MAY_BE_STRING),
FN("nl2br", MAY_BE_STRING),
F1("basename", MAY_BE_STRING),
F1("dirname", MAY_BE_NULL | MAY_BE_STRING),
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 757dcec..39739c8 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4345,7 +4345,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
ZEND_PARSE_PARAMETERS_END();
if (str_len == 0) {
- RETURN_FALSE;
+ RETURN_EMPTY_STRING();
}
tmp = str;