zend_func_info: Remove null from methods with non-null return type
authorTyson Andre <tysonandre775@hotmail.com>
Sat, 15 Jun 2019 21:12:18 +0000 (17:12 -0400)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Jun 2019 10:36:30 +0000 (12:36 +0200)
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

index 684831b320e51d0940ad9c18ef3b3bc337a93b2b..2479c3bb519fd758c911359c0a6656ae8a007a67 100644 (file)
@@ -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),