Skip to content

Fix other incorrect opcache types #4959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 42 additions & 41 deletions ext/opcache/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ static const func_info_t func_infos[] = {
FN("constant", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_STRING | MAY_BE_RESOURCE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("bin2hex", MAY_BE_FALSE | MAY_BE_STRING),
F1("hex2bin", MAY_BE_FALSE | MAY_BE_STRING),
F0("sleep", MAY_BE_FALSE | MAY_BE_LONG),
F0("usleep", MAY_BE_NULL | MAY_BE_FALSE),
#if HAVE_NANOSLEEP
F1("time_nanosleep", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
F0("time_sleep_until", MAY_BE_FALSE | MAY_BE_TRUE),
Expand All @@ -129,7 +127,7 @@ static const func_info_t func_infos[] = {
F1("strptime", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
#endif
F0("flush", MAY_BE_NULL),
F1("wordwrap", MAY_BE_FALSE | MAY_BE_STRING),
F1("wordwrap", MAY_BE_STRING),
F1("htmlspecialchars", MAY_BE_STRING),
F1("htmlentities", MAY_BE_STRING),
FN("html_entity_decode", MAY_BE_FALSE | MAY_BE_STRING),
Expand Down Expand Up @@ -175,8 +173,8 @@ static const func_info_t func_infos[] = {
F1("stristr", MAY_BE_FALSE | MAY_BE_STRING),
F1("strrchr", MAY_BE_FALSE | 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("str_word_count", MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("str_split", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
F0("substr_compare", MAY_BE_FALSE | MAY_BE_LONG),
#ifdef HAVE_STRFMON
Expand All @@ -188,14 +186,14 @@ static const func_info_t func_infos[] = {
FN("ucfirst", MAY_BE_STRING),
FN("lcfirst", MAY_BE_STRING),
F1("ucwords", MAY_BE_STRING),
FN("strtr", MAY_BE_FALSE | MAY_BE_STRING),
FN("strtr", MAY_BE_STRING),
FN("addslashes", MAY_BE_STRING),
F1("addcslashes", MAY_BE_STRING),
FN("rtrim", MAY_BE_STRING),
FN("chop", MAY_BE_STRING),
FN("str_replace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
FN("str_ireplace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
F1("str_repeat", MAY_BE_NULL | MAY_BE_STRING),
F1("str_repeat", MAY_BE_STRING),
F1("count_chars", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("chunk_split", MAY_BE_FALSE | MAY_BE_STRING),
FN("trim", MAY_BE_STRING),
Expand All @@ -212,8 +210,8 @@ static const func_info_t func_infos[] = {
F1("soundex", MAY_BE_FALSE | MAY_BE_STRING),
F0("levenshtein", MAY_BE_LONG),
F1("chr", MAY_BE_STRING),
F1("str_getcsv", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
FN("str_pad", MAY_BE_NULL | MAY_BE_STRING),
F1("str_getcsv", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
FN("str_pad", MAY_BE_STRING),
F1("strchr", MAY_BE_FALSE | MAY_BE_STRING),
F1("sprintf", MAY_BE_FALSE | MAY_BE_STRING),
F0("printf", MAY_BE_FALSE | MAY_BE_LONG),
Expand Down Expand Up @@ -244,19 +242,15 @@ static const func_info_t func_infos[] = {
F1("shell_exec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
F1("proc_open", MAY_BE_FALSE | MAY_BE_RESOURCE),
F0("proc_close", MAY_BE_FALSE | MAY_BE_LONG),
F0("proc_terminate", MAY_BE_FALSE | MAY_BE_TRUE),
F1("proc_get_status", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
F1("proc_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
#endif
#ifdef HAVE_NICE
F0("proc_nice", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F0("rand", MAY_BE_NULL | MAY_BE_LONG),
F1("random_bytes", MAY_BE_STRING),
F1("random_int", MAY_BE_LONG),
F0("srand", MAY_BE_NULL),
F0("getrandmax", MAY_BE_NULL | MAY_BE_LONG),
F0("mt_rand", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("mt_srand", MAY_BE_NULL),
F0("mt_getrandmax", MAY_BE_LONG),
#if HAVE_GETSERVBYNAME
Expand Down Expand Up @@ -286,7 +280,6 @@ static const func_info_t func_infos[] = {
F0("abs", MAY_BE_LONG | MAY_BE_DOUBLE),
F0("ceil", MAY_BE_DOUBLE),
F0("floor", MAY_BE_DOUBLE),
F0("round", MAY_BE_FALSE | MAY_BE_DOUBLE),
F0("expm1", MAY_BE_DOUBLE),
F0("log1p", MAY_BE_DOUBLE),
F1("pow", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_OBJECT),
Expand Down Expand Up @@ -356,7 +349,6 @@ static const func_info_t func_infos[] = {
F0("memory_get_usage", MAY_BE_FALSE | MAY_BE_LONG),
F0("memory_get_peak_usage", MAY_BE_FALSE | MAY_BE_LONG),
F0("register_shutdown_function", MAY_BE_NULL | MAY_BE_FALSE),
F0("register_tick_function", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("unregister_tick_function", MAY_BE_NULL),
F1("highlight_file", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
F1("show_source", MAY_BE_FALSE | MAY_BE_STRING),
Expand All @@ -365,13 +357,13 @@ static const func_info_t func_infos[] = {
FN("ini_get", MAY_BE_FALSE | MAY_BE_STRING),
F1("ini_get_all", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
FN("ini_set", MAY_BE_FALSE | MAY_BE_STRING),
F1("ini_alter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("ini_alter", MAY_BE_FALSE | MAY_BE_STRING),
F0("ini_restore", MAY_BE_NULL),
F1("get_include_path", MAY_BE_FALSE | MAY_BE_STRING),
F1("set_include_path", MAY_BE_FALSE | MAY_BE_STRING),
F0("restore_include_path", MAY_BE_NULL),
F1("headers_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("http_response_code", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("http_response_code", MAY_BE_FALSE | MAY_BE_LONG),
F0("connection_aborted", MAY_BE_LONG),
F0("connection_status", MAY_BE_LONG),
F0("ignore_user_abort", MAY_BE_LONG),
Expand Down Expand Up @@ -499,7 +491,6 @@ static const func_info_t func_infos[] = {
F0("chroot", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F1("getcwd", MAY_BE_FALSE | MAY_BE_STRING),
F0("rewinddir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("readdir", MAY_BE_FALSE | MAY_BE_STRING),
F1("dir", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("scandir", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
Expand Down Expand Up @@ -539,6 +530,7 @@ static const func_info_t func_infos[] = {
F0("mail", MAY_BE_FALSE | MAY_BE_TRUE),
F0("ezmlm_hash", MAY_BE_LONG),
#ifdef HAVE_SYSLOG_H
F0("syslog", MAY_BE_TRUE),
F0("closelog", MAY_BE_TRUE),
#endif
F1("metaphone", MAY_BE_FALSE | MAY_BE_STRING),
Expand All @@ -548,6 +540,17 @@ static const func_info_t func_infos[] = {
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),
F1("ob_list_handlers", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("array_walk", MAY_BE_TRUE),
F0("array_walk_recursive", MAY_BE_TRUE),
F0("arsort", MAY_BE_TRUE),
F0("asort", MAY_BE_TRUE),
F0("krsort", MAY_BE_TRUE),
F0("ksort", MAY_BE_TRUE),
F0("shuffle", MAY_BE_TRUE),
F0("sort", MAY_BE_TRUE),
F0("usort", MAY_BE_TRUE),
F0("uasort", MAY_BE_TRUE),
F0("uksort", MAY_BE_TRUE),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #4954 but eh ... let's just include it.

FN("end", UNKNOWN_INFO),
FN("prev", UNKNOWN_INFO),
FN("next", UNKNOWN_INFO),
Expand Down Expand Up @@ -663,14 +666,14 @@ static const func_info_t func_infos[] = {
F1("date_sun_info", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG),

/* ext/preg */
F0("preg_match", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("preg_match", MAY_BE_FALSE | MAY_BE_LONG),
F0("preg_match_all", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
FN("preg_replace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
FN("preg_replace_callback", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
F1("preg_filter", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
F1("preg_split", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
FN("preg_replace", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
FN("preg_replace_callback", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
F1("preg_filter", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
F1("preg_split", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
FN("preg_quote", MAY_BE_STRING),
F1("preg_grep", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("preg_grep", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),

/* ext/mysqli */
F1("mysqli_connect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
Expand Down Expand Up @@ -776,19 +779,17 @@ static const func_info_t func_infos[] = {
/* ext/curl */
F1("curl_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("curl_copy_handle", MAY_BE_NULL | MAY_BE_RESOURCE),
F1("curl_version", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
FN("curl_exec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_version", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
FN("curl_exec", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
F1("curl_getinfo", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("curl_error", MAY_BE_STRING),
F1("curl_strerror", MAY_BE_NULL | MAY_BE_STRING),
F1("curl_multi_strerror", MAY_BE_NULL | MAY_BE_STRING),
F1("curl_escape", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_unescape", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_escape", MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_unescape", MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_multi_init", MAY_BE_RESOURCE),
FN("curl_multi_getcontent", MAY_BE_NULL | MAY_BE_STRING),
F1("curl_multi_info_read", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_RESOURCE),
F0("curl_multi_close", MAY_BE_NULL | MAY_BE_FALSE),
F0("curl_multi_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("curl_multi_info_read", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_RESOURCE),
F1("curl_share_init", MAY_BE_RESOURCE),
F1("curl_file_create", MAY_BE_OBJECT),

Expand Down Expand Up @@ -883,13 +884,13 @@ static const func_info_t func_infos[] = {
F0("gztell", MAY_BE_FALSE | MAY_BE_LONG),
F0("gzwrite", MAY_BE_FALSE | MAY_BE_LONG),
F0("gzputs", MAY_BE_FALSE | MAY_BE_LONG),
F1("gzfile", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("gzcompress", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("gzuncompress", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("gzdeflate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("gzinflate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("gzencode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("gzdecode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("gzfile", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("gzcompress", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzuncompress", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzdeflate", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzinflate", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzencode", MAY_BE_FALSE | MAY_BE_STRING),
F1("gzdecode", MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_get_coding_type", MAY_BE_FALSE | MAY_BE_STRING),
Expand Down Expand Up @@ -1137,8 +1138,8 @@ static const func_info_t func_infos[] = {

/* ext/fileinfo */
F1("finfo_open", MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("finfo_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("finfo_buffer", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("finfo_file", MAY_BE_FALSE | MAY_BE_STRING),
F1("finfo_buffer", MAY_BE_FALSE | MAY_BE_STRING),
F1("mime_content_type", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),

/* ext/gd */
Expand Down