Skip to content

Generate optimizer func info from stubs for ext/gd and ext/pgsql #7408

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 2 commits 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
94 changes: 0 additions & 94 deletions Zend/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,103 +428,9 @@ static const func_info_t old_func_infos[] = {
F1("mhash_get_hash_name", MAY_BE_FALSE | MAY_BE_STRING),
F1("mhash", MAY_BE_FALSE | MAY_BE_FALSE | MAY_BE_STRING),

/* ext/pgsql */
F1("pg_dbname", MAY_BE_STRING),
F1("pg_options", MAY_BE_STRING),
F1("pg_port", MAY_BE_STRING),
F1("pg_tty", MAY_BE_STRING),
F1("pg_host", MAY_BE_STRING),
F1("pg_version", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_NULL),
F1("pg_parameter_status", MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_query", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("pg_query_params", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("pg_prepare", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("pg_execute", MAY_BE_FALSE | MAY_BE_OBJECT),
FN("pg_last_notice", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY ),
F1("pg_field_name", MAY_BE_STRING),
F1("pg_field_type_oid", MAY_BE_LONG | MAY_BE_STRING),
F1("pg_fetch_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_fetch_row", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
F1("pg_fetch_assoc", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
F1("pg_fetch_array", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
F1("pg_fetch_object", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("pg_fetch_all", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
F1("pg_fetch_all_columns", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
F1("pg_last_oid", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
F1("pg_lo_create", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
F1("pg_lo_open", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("pg_lo_read", MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_lo_import", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
F1("pg_copy_to", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("pg_escape_string", MAY_BE_STRING),
F1("pg_escape_bytea", MAY_BE_STRING),
F1("pg_unescape_bytea", MAY_BE_STRING),
F1("pg_escape_literal", MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_escape_identifier", MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_result_error", MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_result_error_field", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("pg_get_result", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("pg_result_status", MAY_BE_LONG | MAY_BE_STRING),
F1("pg_get_notify", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("pg_meta_data", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
F1("pg_convert", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
F1("pg_insert", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_OBJECT | MAY_BE_STRING),
F1("pg_update", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
F1("pg_delete", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
F1("pg_select", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),

/* ext/filter */
F1("filter_var_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),

/* ext/gd */
F1("gd_info", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE),
F1("imagecreatetruecolor", MAY_BE_FALSE | MAY_BE_OBJECT),
#ifdef PHP_WIN32
F1("imagegrabwindow", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagegrabscreen", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
F1("imagerotate", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecreate", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecreatefromstring", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecreatefromgif", MAY_BE_FALSE | MAY_BE_OBJECT),
#ifdef HAVE_GD_JPG
F1("imagecreatefromjpeg", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
#ifdef HAVE_GD_AVIF
F1("imagecreatefromavif", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
#ifdef HAVE_GD_PNG
F1("imagecreatefrompng", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
#ifdef HAVE_GD_WEBP
F1("imagecreatefromwebp", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
F1("imagecreatefromxbm", MAY_BE_FALSE | MAY_BE_OBJECT),
#if defined(HAVE_GD_XPM)
F1("imagecreatefromxpm", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
F1("imagecreatefromwbmp", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecreatefromgd", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecreatefromgd2", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecreatefromgd2part", MAY_BE_FALSE | MAY_BE_OBJECT),
#if defined(HAVE_GD_BMP)
F1("imagecreatefrombmp", MAY_BE_FALSE | MAY_BE_OBJECT),
#endif
F0("imagecolorset", MAY_BE_NULL | MAY_BE_FALSE),
F1("imagecolorsforindex", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
F1("imagegetclip", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imageftbbox", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imagefttext", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imagettfbbox", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imagettftext", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
F1("imagecrop", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagecropauto", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imagescale", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imageaffine", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("imageaffinematrixget", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
F1("imageaffinematrixconcat", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
F1("imageresolution", MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),

/* ext/spl */
F1("iterator_to_array", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),

Expand Down
93 changes: 93 additions & 0 deletions Zend/Optimizer/zend_func_infos.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,100 @@ static const func_info_t func_infos[] = {
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_dbname", MAY_BE_STRING),
F1("pg_options", MAY_BE_STRING),
F1("pg_port", MAY_BE_STRING),
F1("pg_tty", MAY_BE_STRING),
F1("pg_host", MAY_BE_STRING),
F1("pg_version", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL),
F1("pg_parameter_status", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_query", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_query_params", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_prepare", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_execute", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_field_name", MAY_BE_STRING),
F1("pg_field_type_oid", MAY_BE_STRING|MAY_BE_LONG),
F1("pg_fetch_result", MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL),
F1("pg_fetch_row", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
F1("pg_fetch_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
F1("pg_fetch_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
F1("pg_fetch_object", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_fetch_all", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY),
F1("pg_fetch_all_columns", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL),
F1("pg_last_oid", MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE),
F1("pg_lo_create", MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE),
F1("pg_lo_open", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_lo_read", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_lo_import", MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE),
F1("pg_copy_to", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
F1("pg_escape_string", MAY_BE_STRING),
F1("pg_escape_bytea", MAY_BE_STRING),
F1("pg_unescape_bytea", MAY_BE_STRING),
F1("pg_escape_literal", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_escape_identifier", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_result_error", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_result_error_field", MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL),
F1("pg_get_result", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_result_status", MAY_BE_STRING|MAY_BE_LONG),
F1("pg_get_notify", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
F1("pg_meta_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("pg_convert", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("pg_insert", MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_BOOL),
F1("pg_update", MAY_BE_STRING|MAY_BE_BOOL),
F1("pg_delete", MAY_BE_STRING|MAY_BE_BOOL),
F1("pg_select", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_STRING|MAY_BE_FALSE),
F1("gd_info", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE),
F1("imagecreatetruecolor", MAY_BE_OBJECT|MAY_BE_FALSE),
#if defined(PHP_WIN32)
F1("imagegrabwindow", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
#if defined(PHP_WIN32)
F1("imagegrabscreen", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
F1("imagerotate", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagecreate", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagecreatefromstring", MAY_BE_OBJECT|MAY_BE_FALSE),
#if defined(HAVE_GD_AVIF)
F1("imagecreatefromavif", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
F1("imagecreatefromgif", MAY_BE_OBJECT|MAY_BE_FALSE),
#if defined(HAVE_GD_JPG)
F1("imagecreatefromjpeg", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
#if defined(HAVE_GD_PNG)
F1("imagecreatefrompng", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
#if defined(HAVE_GD_WEBP)
F1("imagecreatefromwebp", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
F1("imagecreatefromxbm", MAY_BE_OBJECT|MAY_BE_FALSE),
#if defined(HAVE_GD_XPM)
F1("imagecreatefromxpm", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
F1("imagecreatefromwbmp", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagecreatefromgd", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagecreatefromgd2", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagecreatefromgd2part", MAY_BE_OBJECT|MAY_BE_FALSE),
#if defined(HAVE_GD_BMP)
F1("imagecreatefrombmp", MAY_BE_OBJECT|MAY_BE_FALSE),
#endif
F0("imagecolorset", MAY_BE_FALSE|MAY_BE_NULL),
F1("imagecolorsforindex", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG),
F1("imagegetclip", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG),
#if defined(HAVE_GD_FREETYPE)
F1("imageftbbox", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE),
#endif
#if defined(HAVE_GD_FREETYPE)
F1("imagefttext", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE),
#endif
F1("imagecrop", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagecropauto", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imagescale", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imageaffine", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("imageaffinematrixget", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_FALSE),
F1("imageaffinematrixconcat", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_FALSE),
F1("imageresolution", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_TRUE),
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),
Expand Down
68 changes: 64 additions & 4 deletions ext/gd/gd.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ final class GdImage {}
*/
final class GdFont {}

/**
* @return array<string, string|bool>
* @refcount 1
*/
function gd_info(): array {}

function imageloadfont(string $filename): GdFont|false {}

function imagesetstyle(GdImage $image, array $style): bool {}

/** @refcount 1 */
function imagecreatetruecolor(int $width, int $height): GdImage|false {}

function imageistruecolor(GdImage $image): bool {}
Expand Down Expand Up @@ -54,58 +59,75 @@ function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x,

#ifdef PHP_WIN32

/** @refcount 1 */
function imagegrabwindow(int $handle, bool $client_area = false): GdImage|false {}

/** @refcount 1 */
function imagegrabscreen(): GdImage|false {}

#endif

// TODO: $ignore_transparent is ignored???
/** @refcount 1 */
function imagerotate(GdImage $image, float $angle, int $background_color, bool $ignore_transparent = false): GdImage|false {}

function imagesettile(GdImage $image, GdImage $tile): bool {}

function imagesetbrush(GdImage $image, GdImage $brush): bool {}

/** @refcount 1 */
function imagecreate(int $width, int $height): GdImage|false {}

function imagetypes(): int {}

/** @refcount 1 */
function imagecreatefromstring(string $data): GdImage|false {}

#ifdef HAVE_GD_AVIF
/** @refcount 1 */
function imagecreatefromavif(string $filename): GdImage|false {}
#endif

/** @refcount 1 */
function imagecreatefromgif(string $filename): GdImage|false {}

#ifdef HAVE_GD_JPG
/** @refcount 1 */
function imagecreatefromjpeg(string $filename): GdImage|false {}
#endif

#ifdef HAVE_GD_PNG
/** @refcount 1 */
function imagecreatefrompng(string $filename): GdImage|false {}
#endif

#ifdef HAVE_GD_WEBP
/** @refcount 1 */
function imagecreatefromwebp(string $filename): GdImage|false {}
#endif

/** @refcount 1 */
function imagecreatefromxbm(string $filename): GdImage|false {}

#ifdef HAVE_GD_XPM
/** @refcount 1 */
function imagecreatefromxpm(string $filename): GdImage|false {}
#endif

/** @refcount 1 */
function imagecreatefromwbmp(string $filename): GdImage|false {}

/** @refcount 1 */
function imagecreatefromgd(string $filename): GdImage|false {}

/** @refcount 1 */
function imagecreatefromgd2(string $filename): GdImage|false {}

/** @refcount 1 */
function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height): GdImage|false {}

#ifdef HAVE_GD_BMP
/** @refcount 1 */
function imagecreatefrombmp(string $filename): GdImage|false {}
#endif

Expand Down Expand Up @@ -168,8 +190,13 @@ function imagecolorresolve(GdImage $image, int $red, int $green, int $blue): int

function imagecolorexact(GdImage $image, int $red, int $green, int $blue): int {}

/** @return false|null */
function imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0): ?bool {}

/**
* @return array<string, int>
* @refcount 1
*/
function imagecolorsforindex(GdImage $image, int $color): array {}

function imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma): bool {}
Expand Down Expand Up @@ -230,17 +257,35 @@ function imagesy(GdImage $image): int {}

function imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2): bool {}

/**
* @return array<int, int>
* @refcount 1
*/
function imagegetclip(GdImage $image): array {}

#ifdef HAVE_GD_FREETYPE
/**
* @return array<int, int>|false
* @refcount 1
*/
function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}

/**
* @return array<int, int>|false
* @refcount 1
*/
function imagefttext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}

/** @alias imageftbbox */
/**
* @return array<int, int>|false
* @alias imageftbbox
*/
function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}

/** @alias imagefttext */
/**
* @return array<int, int>|false
* @alias imagefttext
*/
function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}
#endif

Expand All @@ -253,22 +298,37 @@ function imageflip(GdImage $image, int $mode): bool {}

function imageantialias(GdImage $image, bool $enable): bool {}

/** @refcount 1 */
function imagecrop(GdImage $image, array $rectangle): GdImage|false {}

/** @refcount 1 */
function imagecropauto(GdImage $image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1): GdImage|false {}

/** @refcount 1 */
function imagescale(GdImage $image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED): GdImage|false {}

/** @refcount 1 */
function imageaffine(GdImage $image, array $affine, ?array $clip = null): GdImage|false {}

/** @param array|float $options */
/**
* @param array|float $options
* @refcount 1
* @return array<int, float>|false
*/
function imageaffinematrixget(int $type, $options): array|false {}

/**
* @return array<int, float>|false
* @refcount 1
*/
function imageaffinematrixconcat(array $matrix1, array $matrix2): array|false {}

function imagegetinterpolation(GdImage $image): int {}

function imagesetinterpolation(GdImage $image, int $method = IMG_BILINEAR_FIXED): bool {}

/**
* @return array<int, int>|true
* @refcount 1
*/
function imageresolution(GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null): array|bool {}

2 changes: 1 addition & 1 deletion ext/gd/gd_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: 301ffe25399211f04e4aa377152c9ca9ec81e1d0 */
* Stub hash: 722e0701b4ded4747d71433c11b9575e41826be3 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
Expand Down
Loading