From 38c0f6056b18d84073d44e5d4a8e76cd56e5beb0 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sat, 15 Jun 2019 17:12:18 -0400 Subject: [PATCH] zend_func_info: Remove null from methods with non-null return type Detected by parsing the strings in zend_func_info.c, looping over them and checking for inconsistencies with Reflection. (new ReflectionFunction('str_shuffle')->getReturnType()) would be a non-null 'string', for example. - e.g. that change was made in 7393777da97977db5a4786a4dbe765bde4bc3921 for php 8.0 Closes GH-4269. --- ext/opcache/Optimizer/zend_func_info.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index 684831b320..2479c3bb51 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -201,7 +201,7 @@ static const func_info_t func_infos[] = { F1("strstr", MAY_BE_FALSE | MAY_BE_STRING), F1("stristr", MAY_BE_FALSE | MAY_BE_STRING), F1("strrchr", MAY_BE_FALSE | MAY_BE_STRING), - F1("str_shuffle", MAY_BE_NULL | MAY_BE_STRING), + F1("str_shuffle", MAY_BE_STRING), F1("str_word_count", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("str_split", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING), @@ -385,8 +385,8 @@ static const func_info_t func_infos[] = { F1("quoted_printable_encode", MAY_BE_STRING), F1("convert_cyr_string", MAY_BE_STRING), F1("get_current_user", MAY_BE_STRING), - F0("set_time_limit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), - F0("header_register_callback", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), + F0("set_time_limit", MAY_BE_FALSE | MAY_BE_TRUE), + F0("header_register_callback", MAY_BE_FALSE | MAY_BE_TRUE), F1("get_cfg_var", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), F0("magic_quotes_runtime", MAY_BE_FALSE), F0("set_magic_quotes_runtime", MAY_BE_FALSE), @@ -641,10 +641,10 @@ static const func_info_t func_infos[] = { F1("ob_get_clean", MAY_BE_FALSE | MAY_BE_STRING), F0("ob_get_length", MAY_BE_FALSE | MAY_BE_LONG), F0("ob_get_level", MAY_BE_LONG), - F1("ob_get_status", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), + F1("ob_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), FN("ob_get_contents", MAY_BE_FALSE | MAY_BE_STRING), F0("ob_implicit_flush", MAY_BE_NULL), - F1("ob_list_handlers", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), + F1("ob_list_handlers", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F0("ksort", MAY_BE_FALSE | MAY_BE_TRUE), F0("krsort", MAY_BE_FALSE | MAY_BE_TRUE), F0("natsort", MAY_BE_FALSE | MAY_BE_TRUE), -- 2.50.1