Skip to content

Generate optimizer func info from stubs for ext/curl, ext/mysqli, ext/pcre #7407

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

Merged
merged 1 commit into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
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
67 changes: 0 additions & 67 deletions Zend/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,75 +342,8 @@ static const func_info_t old_func_infos[] = {
F1("sys_get_temp_dir", MAY_BE_STRING),

/* ext/preg */
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),
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_FALSE | MAY_BE_OBJECT),
F0("mysqli_close", MAY_BE_TRUE),
F1("mysqli_connect_error", MAY_BE_NULL | MAY_BE_STRING),
F1("mysqli_get_client_stats", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
F1("mysqli_error_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
F1("mysqli_get_links_stats", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
F1("mysqli_query", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_OBJECT),
F1("mysqli_get_charset", MAY_BE_NULL | MAY_BE_OBJECT),
F1("mysqli_fetch_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mysqli_fetch_assoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mysqli_fetch_all", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mysqli_fetch_object", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_affected_rows", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_character_set_name", MAY_BE_STRING),
F0("mysqli_debug", MAY_BE_TRUE),
F1("mysqli_error", MAY_BE_STRING),
F1("mysqli_reap_async_query", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_OBJECT),
F1("mysqli_stmt_get_result", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_get_warnings", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_stmt_error_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
F1("mysqli_stmt_get_warnings", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_fetch_field", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_fetch_fields", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_OBJECT),
F1("mysqli_fetch_field_direct", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_fetch_lengths", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("mysqli_fetch_row", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
F1("mysqli_get_client_info", MAY_BE_STRING),
F1("mysqli_get_host_info", MAY_BE_STRING),
F1("mysqli_get_server_info", MAY_BE_STRING),
F1("mysqli_info", MAY_BE_NULL | MAY_BE_STRING),
F1("mysqli_init", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_insert_id", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_num_rows", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_prepare", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_real_escape_string", MAY_BE_STRING),
F1("mysqli_stmt_affected_rows", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_stmt_insert_id", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_stmt_num_rows", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_sqlstate", MAY_BE_STRING),
F0("mysqli_ssl_set", MAY_BE_TRUE),
F1("mysqli_stat", MAY_BE_FALSE | MAY_BE_STRING),
F1("mysqli_stmt_error", MAY_BE_STRING),
F1("mysqli_stmt_init", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_stmt_result_metadata", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_stmt_sqlstate", MAY_BE_STRING),
F1("mysqli_store_result", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_use_result", MAY_BE_FALSE | MAY_BE_OBJECT),

/* ext/curl */
F1("curl_init", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("curl_copy_handle", MAY_BE_FALSE | MAY_BE_OBJECT),
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),
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_FALSE | MAY_BE_STRING),
F1("curl_unescape", MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_multi_init", MAY_BE_OBJECT),
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_OBJECT),
F1("curl_share_init", MAY_BE_OBJECT),
F1("curl_file_create", MAY_BE_OBJECT),

/* ext/mbstring */
F1("mb_convert_case", MAY_BE_STRING),
F1("mb_strtoupper", MAY_BE_STRING),
Expand Down
74 changes: 74 additions & 0 deletions Zend/Optimizer/zend_func_infos.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ static const func_info_t func_infos[] = {
F1("stream_socket_accept", MAY_BE_RESOURCE|MAY_BE_FALSE),
FN("zip_open", MAY_BE_RESOURCE|MAY_BE_LONG|MAY_BE_FALSE),
FN("zip_read", MAY_BE_RESOURCE|MAY_BE_FALSE),
F1("curl_copy_handle", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("curl_error", MAY_BE_STRING),
F1("curl_escape", MAY_BE_STRING|MAY_BE_FALSE),
F1("curl_unescape", MAY_BE_STRING|MAY_BE_FALSE),
F1("curl_file_create", MAY_BE_OBJECT),
F1("curl_init", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("curl_multi_info_read", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_FALSE),
F1("curl_multi_init", MAY_BE_OBJECT),
F1("curl_multi_strerror", MAY_BE_STRING|MAY_BE_NULL),
F1("curl_share_init", MAY_BE_OBJECT),
F1("curl_share_strerror", MAY_BE_STRING|MAY_BE_NULL),
F1("curl_strerror", MAY_BE_STRING|MAY_BE_NULL),
F1("curl_version", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("json_encode", MAY_BE_STRING|MAY_BE_FALSE),
F1("json_last_error_msg", MAY_BE_STRING),
F1("finfo_open", MAY_BE_OBJECT|MAY_BE_FALSE),
Expand Down Expand Up @@ -139,10 +152,71 @@ static const func_info_t func_infos[] = {
#if defined(HAVE_BIND_TEXTDOMAIN_CODESET)
F1("bind_textdomain_codeset", MAY_BE_STRING|MAY_BE_FALSE),
#endif
F1("mysqli_affected_rows", MAY_BE_LONG|MAY_BE_STRING),
F1("mysqli_character_set_name", MAY_BE_STRING),
F0("mysqli_close", MAY_BE_TRUE),
F1("mysqli_connect", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_connect_error", MAY_BE_STRING|MAY_BE_NULL),
F0("mysqli_debug", MAY_BE_TRUE),
F1("mysqli_error", MAY_BE_STRING),
F1("mysqli_error_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY),
F1("mysqli_fetch_field", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_fetch_fields", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT),
F1("mysqli_fetch_field_direct", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_fetch_lengths", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE),
F1("mysqli_fetch_all", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY),
F1("mysqli_fetch_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_NULL|MAY_BE_FALSE),
F1("mysqli_fetch_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_NULL|MAY_BE_FALSE),
F1("mysqli_fetch_object", MAY_BE_OBJECT|MAY_BE_NULL|MAY_BE_FALSE),
F1("mysqli_fetch_row", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY|MAY_BE_NULL|MAY_BE_FALSE),
#if defined(MYSQLI_USE_MYSQLND)
F1("mysqli_get_connection_stats", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY),
#endif
#if defined(MYSQLI_USE_MYSQLND)
F1("mysqli_get_client_stats", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
#endif
F1("mysqli_get_charset", MAY_BE_OBJECT|MAY_BE_NULL),
F1("mysqli_get_client_info", MAY_BE_STRING),
F1("mysqli_get_links_stats", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG),
F1("mysqli_get_host_info", MAY_BE_STRING),
F1("mysqli_get_server_info", MAY_BE_STRING),
F1("mysqli_get_warnings", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_init", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_info", MAY_BE_STRING|MAY_BE_NULL),
F1("mysqli_insert_id", MAY_BE_LONG|MAY_BE_STRING),
F1("mysqli_num_rows", MAY_BE_LONG|MAY_BE_STRING),
F1("mysqli_prepare", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_query", MAY_BE_OBJECT|MAY_BE_BOOL),
F1("mysqli_real_escape_string", MAY_BE_STRING),
#if defined(MYSQLI_USE_MYSQLND)
F1("mysqli_reap_async_query", MAY_BE_OBJECT|MAY_BE_BOOL),
#endif
F1("mysqli_stmt_affected_rows", MAY_BE_LONG|MAY_BE_STRING),
F0("mysqli_stmt_close", MAY_BE_TRUE),
F1("mysqli_stmt_error", MAY_BE_STRING),
F1("mysqli_stmt_error_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY),
#if defined(MYSQLI_USE_MYSQLND)
F1("mysqli_stmt_get_result", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
F1("mysqli_stmt_get_warnings", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_stmt_init", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_stmt_insert_id", MAY_BE_LONG|MAY_BE_STRING),
F1("mysqli_stmt_num_rows", MAY_BE_LONG|MAY_BE_STRING),
F1("mysqli_stmt_result_metadata", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_stmt_sqlstate", MAY_BE_STRING),
F1("mysqli_sqlstate", MAY_BE_STRING),
F0("mysqli_ssl_set", MAY_BE_TRUE),
F1("mysqli_stat", MAY_BE_STRING|MAY_BE_FALSE),
F1("mysqli_store_result", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("mysqli_use_result", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("exif_tagname", MAY_BE_STRING|MAY_BE_FALSE),
F1("exif_read_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("exif_thumbnail", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
FN("preg_replace", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
FN("preg_filter", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
FN("preg_replace_callback", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
F1("preg_split", 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),
FN("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
FN("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F0("sodium_crypto_generichash_update", MAY_BE_TRUE),
Expand Down
21 changes: 20 additions & 1 deletion ext/curl/curl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,30 @@ final class CurlShareHandle

function curl_close(CurlHandle $handle): void {}

/** @refcount 1 */
function curl_copy_handle(CurlHandle $handle): CurlHandle|false {}

function curl_errno(CurlHandle $handle): int {}

/** @refcount 1 */
function curl_error(CurlHandle $handle): string {}

/** @refcount 1 */
function curl_escape(CurlHandle $handle, string $string): string|false {}

/** @refcount 1 */
function curl_unescape(CurlHandle $handle, string $string): string|false {}

function curl_multi_setopt(CurlMultiHandle $multi_handle, int $option, mixed $value): bool {}

function curl_exec(CurlHandle $handle): string|bool {}

/** @refcount 1 */
function curl_file_create(string $filename, ?string $mime_type = null, ?string $posted_filename = null): CURLFile {}

function curl_getinfo(CurlHandle $handle, ?int $option = null): mixed {}

/** @refcount 1 */
function curl_init(?string $url = null): CurlHandle|false {}

function curl_multi_add_handle(CurlMultiHandle $multi_handle, CurlHandle $handle): int {}
Expand All @@ -59,15 +65,21 @@ function curl_multi_exec(CurlMultiHandle $multi_handle, &$still_running): int {}

function curl_multi_getcontent(CurlHandle $handle): ?string {}

/** @param int $queued_messages */
/**
* @param int $queued_messages
* @return array<string, int|object>|false
* @refcount 1
*/
function curl_multi_info_read(CurlMultiHandle $multi_handle, &$queued_messages = null): array|false {}

/** @refcount 1 */
function curl_multi_init(): CurlMultiHandle {}

function curl_multi_remove_handle(CurlMultiHandle $multi_handle, CurlHandle $handle): int {}

function curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0): int {}

/** @refcount 1 */
function curl_multi_strerror(int $error_code): ?string {}

function curl_pause(CurlHandle $handle, int $flags): int {}
Expand All @@ -82,12 +94,19 @@ function curl_share_close(CurlShareHandle $share_handle): void {}

function curl_share_errno(CurlShareHandle $share_handle): int {}

/** @refcount 1 */
function curl_share_init(): CurlShareHandle {}

function curl_share_setopt(CurlShareHandle $share_handle, int $option, mixed $value): bool {}

/** @refcount 1 */
function curl_share_strerror(int $error_code): ?string {}

/** @refcount 1 */
function curl_strerror(int $error_code): ?string {}

/**
* @return array<string, int|string|array>|false
* @refcount 1
*/
function curl_version(): array|false {}
2 changes: 1 addition & 1 deletion ext/curl/curl_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: c667191d35c8822b6e1f38ddd1e2743e78d4c3c0 */
* Stub hash: 3abf3f6d5dfb14d2e22ebf5730a869e2c17c7958 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0)
ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0)
Expand Down
Loading