Generate optimizer func info from stubs for ext/standard - part 3 (#7426)

This commit is contained in:
Máté Kocsis 2021-08-30 15:56:47 +02:00 committed by GitHub
parent 1bf1481a2a
commit c19e4b9997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 236 additions and 93 deletions

View file

@ -88,81 +88,7 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
}
static const func_info_t old_func_infos[] = {
/* ext/standard */
F1("parse_ini_file", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
F1("parse_ini_string", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
F1("pack", MAY_BE_STRING),
F1("unpack", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("get_browser", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_OBJECT | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
F1("crypt", MAY_BE_STRING),
F1("getcwd", MAY_BE_FALSE | MAY_BE_STRING),
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),
#ifdef HAVE_GLOB
F1("glob", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
#endif
F1("filetype", MAY_BE_FALSE | MAY_BE_STRING),
F1("stat", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
F1("lstat", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
F1("realpath_cache_get", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
#ifdef HAVE_SYSLOG_H
F0("syslog", MAY_BE_TRUE),
F0("closelog", MAY_BE_TRUE),
#endif
F1("metaphone", MAY_BE_STRING),
F1("ob_get_flush", MAY_BE_FALSE | MAY_BE_STRING),
F1("ob_get_clean", MAY_BE_FALSE | MAY_BE_STRING),
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),
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),
F1("compact", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
FN("array_fill", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
F1("array_fill_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
FC("range", zend_range_info),
F1("array_replace", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_replace_recursive", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
FN("array_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
FN("array_values", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_count_values", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG),
F1("array_column", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_reverse", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_flip", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
F1("array_change_key_case", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
FN("array_rand", MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
F1("array_intersect", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_intersect_key", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_intersect_ukey", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_uintersect", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_intersect_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_uintersect_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_intersect_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_uintersect_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_diff_key", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_diff_ukey", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_udiff", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_diff_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_udiff_assoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_diff_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("array_udiff_uassoc", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
F1("str_rot13", MAY_BE_STRING),
F1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_OBJECT),
F1("stream_bucket_new", MAY_BE_OBJECT),
F1("sys_get_temp_dir", MAY_BE_STRING),
F1("utf8_encode", MAY_BE_STRING),
F1("utf8_decode", MAY_BE_STRING),
};
static HashTable func_info;

View file

@ -392,6 +392,49 @@ static const func_info_t func_infos[] = {
F1("spl_classes", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
F1("spl_object_hash", MAY_BE_STRING),
F1("iterator_to_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("ob_get_flush", MAY_BE_STRING|MAY_BE_FALSE),
F1("ob_get_clean", MAY_BE_STRING|MAY_BE_FALSE),
F1("ob_list_handlers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("ob_get_status", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY),
F0("krsort", MAY_BE_TRUE),
F0("ksort", MAY_BE_TRUE),
F0("asort", MAY_BE_TRUE),
F0("arsort", MAY_BE_TRUE),
F0("sort", MAY_BE_TRUE),
F0("usort", MAY_BE_TRUE),
F0("uasort", MAY_BE_TRUE),
F0("uksort", MAY_BE_TRUE),
F0("array_walk", MAY_BE_TRUE),
F0("array_walk_recursive", MAY_BE_TRUE),
F1("compact", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
FN("array_fill", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY),
F1("array_fill_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F0("shuffle", MAY_BE_TRUE),
F1("array_replace", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_replace_recursive", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
FN("array_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
FN("array_values", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_count_values", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG),
F1("array_column", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_reverse", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_flip", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
F1("array_change_key_case", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_intersect_key", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_intersect_ukey", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_intersect", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_uintersect", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_intersect_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_uintersect_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_intersect_uassoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_uintersect_uassoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_diff_key", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_diff_ukey", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_udiff", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_diff_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_diff_uassoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_udiff_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("array_udiff_uassoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
FN("array_rand", MAY_BE_LONG|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
F1("base64_encode", MAY_BE_STRING),
F1("base64_decode", MAY_BE_STRING|MAY_BE_FALSE),
F1("long2ip", MAY_BE_STRING|MAY_BE_FALSE),
@ -417,12 +460,16 @@ static const func_info_t func_infos[] = {
#if HAVE_GETPROTOBYNUMBER
F1("getprotobynumber", MAY_BE_STRING|MAY_BE_FALSE),
#endif
F1("parse_ini_file", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
F1("parse_ini_string", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
#if ZEND_DEBUG
F1("config_get_hash", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY),
#endif
#if defined(HAVE_GETLOADAVG)
F1("sys_getloadavg", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_FALSE),
#endif
F1("get_browser", MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("crypt", MAY_BE_STRING),
#if HAVE_STRPTIME
F1("strptime", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
#endif
@ -439,12 +486,19 @@ static const func_info_t func_infos[] = {
F1("md5_file", MAY_BE_STRING|MAY_BE_FALSE),
F1("sha1", MAY_BE_STRING),
F1("sha1_file", MAY_BE_STRING|MAY_BE_FALSE),
#if defined(HAVE_SYSLOG_H)
F0("closelog", MAY_BE_TRUE),
#endif
#if defined(HAVE_SYSLOG_H)
F0("syslog", MAY_BE_TRUE),
#endif
#if defined(HAVE_INET_NTOP)
F1("inet_ntop", MAY_BE_STRING|MAY_BE_FALSE),
#endif
#if defined(HAVE_INET_PTON)
F1("inet_pton", MAY_BE_STRING|MAY_BE_FALSE),
#endif
F1("metaphone", MAY_BE_STRING),
F1("headers_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("htmlspecialchars", MAY_BE_STRING),
F1("htmlentities", MAY_BE_STRING),
@ -480,11 +534,21 @@ static const func_info_t func_infos[] = {
F1("count_chars", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_STRING),
F1("localeconv", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY),
F1("sscanf", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY|MAY_BE_LONG|MAY_BE_NULL),
F1("str_rot13", MAY_BE_STRING),
F1("str_shuffle", MAY_BE_STRING),
F1("str_word_count", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_LONG),
F1("str_split", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("strpbrk", MAY_BE_STRING|MAY_BE_FALSE),
F1("utf8_encode", MAY_BE_STRING),
F1("utf8_decode", MAY_BE_STRING),
FN("opendir", MAY_BE_RESOURCE|MAY_BE_FALSE),
F1("dir", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("getcwd", MAY_BE_STRING|MAY_BE_FALSE),
F1("readdir", MAY_BE_STRING|MAY_BE_FALSE),
F1("scandir", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
#if defined(HAVE_GLOB)
F1("glob", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
#endif
F1("exec", MAY_BE_STRING|MAY_BE_FALSE),
F1("system", MAY_BE_STRING|MAY_BE_FALSE),
F0("passthru", MAY_BE_FALSE|MAY_BE_NULL),
@ -504,6 +568,11 @@ static const func_info_t func_infos[] = {
F1("file_get_contents", MAY_BE_STRING|MAY_BE_FALSE),
F1("fgetcsv", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
F1("realpath", MAY_BE_STRING|MAY_BE_FALSE),
F1("sys_get_temp_dir", MAY_BE_STRING),
F1("filetype", MAY_BE_STRING|MAY_BE_FALSE),
F1("stat", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|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|MAY_BE_FALSE),
F1("lstat", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|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|MAY_BE_FALSE),
F1("realpath_cache_get", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY),
F1("sprintf", MAY_BE_STRING),
F1("vsprintf", MAY_BE_STRING),
F1("fsockopen", MAY_BE_RESOURCE|MAY_BE_FALSE),
@ -539,6 +608,8 @@ static const func_info_t func_infos[] = {
#if defined(HAVE_GETRUSAGE)
F1("getrusage", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE),
#endif
F1("pack", MAY_BE_STRING),
F1("unpack", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("password_get_info", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_NULL),
F1("password_hash", MAY_BE_STRING),
#if defined(PHP_CAN_SUPPORT_PROC_OPEN)
@ -580,6 +651,9 @@ static const func_info_t func_infos[] = {
F1("rawurlencode", MAY_BE_STRING),
F1("rawurldecode", MAY_BE_STRING),
F1("get_headers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("stream_bucket_make_writeable", MAY_BE_OBJECT|MAY_BE_NULL),
F1("stream_bucket_new", MAY_BE_OBJECT),
F1("stream_get_filters", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("convert_uuencode", MAY_BE_STRING),
F1("convert_uudecode", MAY_BE_STRING|MAY_BE_FALSE),
F1("var_export", MAY_BE_STRING|MAY_BE_NULL),

View file

@ -220,9 +220,13 @@ class SimpleType {
}
$matches = [];
$isArray = preg_match("/array\s*<\s*([A-Za-z0-9_-|]+)\s*,\s*([A-Za-z0-9_-|]+)\s*>/i", $typeString, $matches);
$isArray = preg_match("/array\s*<\s*([A-Za-z0-9_-|]+)?(\s*,\s*)?([A-Za-z0-9_-|]+)?\s*>/i", $typeString, $matches);
if ($isArray) {
return new ArrayType(Type::fromString($matches[1]), Type::fromString($matches[2]));
if (empty($matches[1]) || empty($matches[3])) {
throw new Exception("array<> type hint must have both a key and a value");
}
return new ArrayType(Type::fromString($matches[1]), Type::fromString($matches[3]));
}
return new SimpleType($typeString, false);

View file

@ -31,8 +31,10 @@ function ob_end_flush(): bool {}
function ob_end_clean(): bool {}
/** @refcount 1 */
function ob_get_flush(): string|false {}
/** @refcount 1 */
function ob_get_clean(): string|false {}
function ob_get_contents(): string|false {}
@ -41,8 +43,16 @@ function ob_get_level(): int {}
function ob_get_length(): int|false {}
/**
* @return array<int, string>
* @refcount 1
*/
function ob_list_handlers(): array {}
/**
* @return array<int|string, int|string|array>
* @refcount 1
*/
function ob_get_status(bool $full_status = false): array {}
function ob_implicit_flush(bool $enable = true): void {}
@ -66,8 +76,10 @@ function stream_wrapper_restore(string $protocol): bool {}
function array_push(array &$array, mixed ...$values): int {}
/** @return true */
function krsort(array &$array, int $flags = SORT_REGULAR): bool {}
/** @return true */
function ksort(array &$array, int $flags = SORT_REGULAR): bool {}
function count(Countable|array $value, int $mode = COUNT_NORMAL): int {}
@ -79,18 +91,24 @@ function natsort(array &$array): bool {}
function natcasesort(array &$array): bool {}
/** @return true */
function asort(array &$array, int $flags = SORT_REGULAR): bool {}
/** @return true */
function arsort(array &$array, int $flags = SORT_REGULAR): bool {}
/** @return true */
function sort(array &$array, int $flags = SORT_REGULAR): bool {}
function rsort(array &$array, int $flags = SORT_REGULAR): bool {}
/** @return true */
function usort(array &$array, callable $callback): bool {}
/** @return true */
function uasort(array &$array, callable $callback): bool {}
/** @return true */
function uksort(array &$array, callable $callback): bool {}
function end(array|object &$array): mixed {}
@ -112,8 +130,10 @@ function min(mixed $value, mixed ...$values): mixed {}
function max(mixed $value, mixed ...$values): mixed {}
/** @return true */
function array_walk(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {}
/** @return true */
function array_walk_recursive(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {}
function in_array(mixed $needle, array $haystack, bool $strict = false): bool {}
@ -126,11 +146,15 @@ function extract(array &$array, int $flags = EXTR_OVERWRITE, string $prefix = ""
/**
* @param array|string $var_name
* @param array|string $var_names
* @return array<string, mixed|ref>
* @refcount 1
*/
function compact($var_name, ...$var_names): array {}
/** @return array<int, mixed> */
function array_fill(int $start_index, int $count, mixed $value): array {}
/** @refcount 1 */
function array_fill_keys(array $keys, mixed $value): array {}
/**
@ -139,6 +163,7 @@ function array_fill_keys(array $keys, mixed $value): array {}
*/
function range($start, $end, int|float $step = 1): array {}
/** @return true */
function shuffle(array &$array): bool {}
function array_pop(array &$array): mixed {}
@ -155,72 +180,122 @@ function array_merge(array ...$arrays): array {}
function array_merge_recursive(array ...$arrays): array {}
/** @refcount 1 */
function array_replace(array $array, array ...$replacements): array {}
/** @refcount 1 */
function array_replace_recursive(array $array, array ...$replacements): array {}
/** @return array<int, int|string> */
function array_keys(array $array, mixed $filter_value = UNKNOWN, bool $strict = false): array {}
function array_key_first(array $array): int|string|null {}
function array_key_last(array $array): int|string|null {}
/** @return array<int, mixed|ref> */
function array_values(array $array): array {}
/**
* @return array<int|string, int>
* @refcount 1
*/
function array_count_values(array $array): array {}
/** @refcount 1 */
function array_column(array $array, int|string|null $column_key, int|string|null $index_key = null): array {}
/** @refcount 1 */
function array_reverse(array $array, bool $preserve_keys = false): array {}
function array_pad(array $array, int $length, mixed $value): array {}
/**
* @return array<int|string, int|string>
* @refcount 1
*/
function array_flip(array $array): array {}
/** @refcount 1 */
function array_change_key_case(array $array, int $case = CASE_LOWER): array {}
function array_unique(array $array, int $flags = SORT_STRING): array {}
/** @refcount 1 */
function array_intersect_key(array $array, array ...$arrays): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_intersect_ukey(array $array, ...$rest): array {}
/** @refcount 1 */
function array_intersect(array $array, array ...$arrays): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_uintersect(array $array, ...$rest): array {}
/** @refcount 1 */
function array_intersect_assoc(array $array, array ...$arrays): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_uintersect_assoc(array $array, ...$rest): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_intersect_uassoc(array $array, ...$rest): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_uintersect_uassoc(array $array, ...$rest): array {}
/** @refcount 1 */
function array_diff_key(array $array, array ...$arrays): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_diff_ukey(array $array, ...$rest): array {}
function array_diff(array $array, array ...$arrays): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_udiff(array $array, ...$rest): array {}
/** @refcount 1 */
function array_diff_assoc(array $array, array ...$arrays): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_diff_uassoc(array $array, ...$rest): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_udiff_assoc(array $array, ...$rest): array {}
/** @param array|callable $rest */
/**
* @param array|callable $rest
* @refcount 1
*/
function array_udiff_uassoc(array $array, ...$rest): array {}
/**
@ -231,6 +306,7 @@ function array_udiff_uassoc(array $array, ...$rest): array {}
*/
function array_multisort(&$array, &...$rest): bool {}
/** @return int|string|array<int, int|string> */
function array_rand(array $array, int $num = 1): int|string|array {}
function array_sum(array $array): int|float {}
@ -403,8 +479,16 @@ function is_uploaded_file(string $filename): bool {}
function move_uploaded_file(string $from, string $to): bool {}
/**
* @return array<int|string, bool|int|float|string|array|null>|false
* @refcount 1
*/
function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
/**
* @return array<int|string, bool|int|float|string|array|null>|false
* @refcount 1
*/
function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
#if ZEND_DEBUG
@ -425,6 +509,10 @@ function sys_getloadavg(): array|false {}
/* browscap.c */
/**
* @return object|array<string, mixed>|false
* @refcount 1
*/
function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {}
/* crc32.c */
@ -433,6 +521,7 @@ function crc32(string $string): int {}
/* crypt.c */
/** @refcount 1 */
function crypt(string $string, string $salt): string {}
/* datetime.c */
@ -546,9 +635,11 @@ function sha1_file(string $filename, bool $binary = false): string|false {}
#ifdef HAVE_SYSLOG_H
function openlog(string $prefix, int $flags, int $facility): bool {}
/** @return true */
function closelog(): bool {}
function syslog(int $priority, string $message): bool {}
/** @return true */
function syslog(int $priority, string $message): bool {} // TODO make return type void
#endif
#ifdef HAVE_INET_NTOP
@ -563,6 +654,7 @@ function inet_pton(string $ip): string|false {}
/* metaphone.c */
/** @refcount 1 */
function metaphone(string $string, int $max_phonemes = 0): string {}
/* {{{ head.c */
@ -806,6 +898,7 @@ function str_pad(string $string, int $length, string $pad_string = " ", int $pad
*/
function sscanf(string $string, string $format, mixed &...$vars): array|int|null {}
/** @refcount 1 */
function str_rot13(string $string): string {}
/** @refcount 1 */
@ -828,8 +921,10 @@ function strpbrk(string $string, string $characters): string|false {}
function substr_compare(string $haystack, string $needle, int $offset, ?int $length = null, bool $case_insensitive = false): int {}
/** @refcount 1 */
function utf8_encode(string $string): string {}
/** @refcount 1 */
function utf8_decode(string $string): string {}
/* dir.c */
@ -840,7 +935,10 @@ function utf8_decode(string $string): string {}
*/
function opendir(string $directory, $context = null) {}
/** @param resource|null $context */
/**
* @param resource|null $context
* @refcount 1
*/
function dir(string $directory, $context = null): Directory|false {}
/** @param resource|null $dir_handle */
@ -852,18 +950,30 @@ function chdir(string $directory): bool {}
function chroot(string $directory): bool {}
#endif
/** @refcount 1 */
function getcwd(): string|false {}
/** @param resource|null $dir_handle */
function rewinddir($dir_handle = null): void {}
/** @param resource|null $dir_handle */
/**
* @param resource|null $dir_handle
* @refcount 1
*/
function readdir($dir_handle = null): string|false {}
/** @param resource|null $context */
/**
* @param resource|null $context
* @return array<int, string>|false
* @refcount 1
*/
function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array|false {}
#ifdef HAVE_GLOB
/**
* @return array<int, string>|false
* @refcount 1
*/
function glob(string $pattern, int $flags = 0): array|false {}
#endif
@ -1061,6 +1171,7 @@ function realpath(string $path): string|false {}
function fnmatch(string $pattern, string $filename, int $flags = 0): bool {}
#endif
/** @refcount 1 */
function sys_get_temp_dir(): string {}
/* filestat.c */
@ -1081,6 +1192,7 @@ function fileperms(string $filename): int|false {}
function filesize(string $filename): int|false {}
/** @refcount 1 */
function filetype(string $filename): string|false {}
function file_exists(string $filename): bool {}
@ -1100,8 +1212,16 @@ function is_dir(string $filename): bool {}
function is_link(string $filename): bool {}
/**
* @return array<int|string, bool|int|string>|false
* @refcount 1
*/
function stat(string $filename): array|false {}
/**
* @return array<int|string, bool|int|string>|false
* @refcount 1
*/
function lstat(string $filename): array|false {}
function chown(string $filename, string|int $user): bool {}
@ -1129,6 +1249,10 @@ function disk_free_space(string $directory): float|false {}
/** @alias disk_free_space */
function diskfreespace(string $directory): float|false {}
/**
* @return array<string, array>
* @refcount 1
*/
function realpath_cache_get(): array {}
function realpath_cache_size(): int {}
@ -1364,8 +1488,13 @@ function getrusage(int $mode = 0): array|false {}
/* pack.c */
/** @refcount 1 */
function pack(string $format, mixed ...$values): string {}
/**
* @return array<int|string, mixed>|false
* @refcount 1
*/
function unpack(string $format, string $string, int $offset = 0): array|false {}
/* password.c */
@ -1739,7 +1868,10 @@ function get_headers(string $url, bool $associative = false, $context = null): a
/* user_filters.c */
/** @param resource $brigade */
/**
* @param resource $brigade
* @refcount 1
*/
function stream_bucket_make_writeable($brigade): ?object {}
/** @param resource $brigade */
@ -1748,9 +1880,16 @@ function stream_bucket_prepend($brigade, object $bucket): void {}
/** @param resource $brigade */
function stream_bucket_append($brigade, object $bucket): void {}
/** @param resource $stream */
/**
* @param resource $stream
* @refcount 1
*/
function stream_bucket_new($stream, string $buffer): object {}
/**
* @return array<int, string>
* @refcount 1
*/
function stream_get_filters(): array {}
function stream_filter_register(string $filter_name, string $class): bool {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 76feb2922e5b577a6cf137d66973a255b6bd341c */
* Stub hash: ae39bfb89eba2a827a3e8eafe6771b753af95824 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)