From 4da316d18991ff4dbe0a7315045f7928d66a4381 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 28 May 2019 13:07:03 +0200 Subject: [PATCH] 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. --- ext/opcache/Optimizer/zend_func_info.c | 4 ++-- ext/standard/string.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index dfb4451b2e..ae33da0022 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 757dcec800..39739c82c0 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; -- 2.40.0