From d194cb0d4049547ad61c13012857296b9223c2a2 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 25 May 2025 11:51:34 +0100 Subject: [PATCH 1/3] ext/gd: return void for couple of calls returning true when success is guaranteed. --- ext/gd/gd.c | 30 ------------------------- ext/gd/gd.stub.php | 54 ++++++++++++++++++++++----------------------- ext/gd/gd_arginfo.h | 34 ++++++++++++++-------------- 3 files changed, 44 insertions(+), 74 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index e993fb65f47d0..424eb0dde7988 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -809,8 +809,6 @@ PHP_FUNCTION(imagesetthickness) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageSetThickness(im, thick); - - RETURN_TRUE; } /* }}} */ @@ -833,7 +831,6 @@ PHP_FUNCTION(imagefilledellipse) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageFilledEllipse(im, cx, cy, w, h, color); - RETURN_TRUE; } /* }}} */ @@ -870,8 +867,6 @@ PHP_FUNCTION(imagefilledarc) } gdImageFilledArc(im, cx, cy, w, h, st, e, col, style); - - RETURN_TRUE; } /* }}} */ @@ -890,8 +885,6 @@ PHP_FUNCTION(imagealphablending) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageAlphaBlending(im, blend); - - RETURN_TRUE; } /* }}} */ @@ -910,8 +903,6 @@ PHP_FUNCTION(imagesavealpha) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageSaveAlpha(im, save); - - RETURN_TRUE; } /* }}} */ @@ -930,8 +921,6 @@ PHP_FUNCTION(imagelayereffect) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageAlphaBlending(im, effect); - - RETURN_TRUE; } /* }}} */ @@ -2522,7 +2511,6 @@ PHP_FUNCTION(imagesetpixel) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageSetPixel(im, x, y, col); - RETURN_TRUE; } /* }}} */ @@ -2550,7 +2538,6 @@ PHP_FUNCTION(imageline) col = gdAntiAliased; } gdImageLine(im, x1, y1, x2, y2, col); - RETURN_TRUE; } /* }}} */ @@ -2573,7 +2560,6 @@ PHP_FUNCTION(imagedashedline) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageDashedLine(im, x1, y1, x2, y2, col); - RETURN_TRUE; } /* }}} */ @@ -2596,7 +2582,6 @@ PHP_FUNCTION(imagerectangle) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageRectangle(im, x1, y1, x2, y2, col); - RETURN_TRUE; } /* }}} */ @@ -2618,7 +2603,6 @@ PHP_FUNCTION(imagefilledrectangle) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageFilledRectangle(im, x1, y1, x2, y2, col); - RETURN_TRUE; } /* }}} */ @@ -2654,7 +2638,6 @@ PHP_FUNCTION(imagearc) } gdImageArc(im, cx, cy, w, h, st, e, col); - RETURN_TRUE; } /* }}} */ @@ -2677,7 +2660,6 @@ PHP_FUNCTION(imageellipse) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageEllipse(im, cx, cy, w, h, color); - RETURN_TRUE; } /* }}} */ @@ -2699,7 +2681,6 @@ PHP_FUNCTION(imagefilltoborder) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageFillToBorder(im, x, y, border, col); - RETURN_TRUE; } /* }}} */ @@ -2720,7 +2701,6 @@ PHP_FUNCTION(imagefill) im = php_gd_libgdimageptr_from_zval_p(IM); gdImageFill(im, x, y, col); - RETURN_TRUE; } /* }}} */ @@ -3038,7 +3018,6 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) if (str) { efree(str); } - RETURN_TRUE; } /* }}} */ @@ -3100,7 +3079,6 @@ PHP_FUNCTION(imagecopy) dstY = DY; gdImageCopy(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH); - RETURN_TRUE; } /* }}} */ @@ -3136,7 +3114,6 @@ PHP_FUNCTION(imagecopymerge) pct = PCT; gdImageCopyMerge(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); - RETURN_TRUE; } /* }}} */ @@ -3172,7 +3149,6 @@ PHP_FUNCTION(imagecopymergegray) pct = PCT; gdImageCopyMergeGray(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); - RETURN_TRUE; } /* }}} */ @@ -3230,7 +3206,6 @@ PHP_FUNCTION(imagecopyresized) } gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - RETURN_TRUE; } /* }}} */ @@ -3284,7 +3259,6 @@ PHP_FUNCTION(imagesetclip) im = php_gd_libgdimageptr_from_zval_p(im_zval); gdImageSetClip(im, x1, y1, x2, y2); - RETURN_TRUE; } /* }}} */ @@ -3744,8 +3718,6 @@ PHP_FUNCTION(imageflip) zend_argument_value_error(2, "must be one of IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH"); RETURN_THROWS(); } - - RETURN_TRUE; } /* }}} */ @@ -3765,8 +3737,6 @@ PHP_FUNCTION(imageantialias) if (im->trueColor) { im->AA = alias; } - - RETURN_TRUE; } /* }}} */ diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php index b3b82766ee981..5ae812b7c96d7 100644 --- a/ext/gd/gd.stub.php +++ b/ext/gd/gd.stub.php @@ -498,17 +498,17 @@ function imagepalettetotruecolor(GdImage $image): bool {} function imagecolormatch(GdImage $image1, GdImage $image2): true {} -function imagesetthickness(GdImage $image, int $thickness): true {} +function imagesetthickness(GdImage $image, int $thickness): void {} -function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): true {} +function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): void {} -function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): true {} +function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): void {} -function imagealphablending(GdImage $image, bool $enable): true {} +function imagealphablending(GdImage $image, bool $enable): void {} -function imagesavealpha(GdImage $image, bool $enable): true {} +function imagesavealpha(GdImage $image, bool $enable): void {} -function imagelayereffect(GdImage $image, int $effect): true {} +function imagelayereffect(GdImage $image, int $effect): void {} function imagecolorallocatealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {} @@ -518,7 +518,7 @@ function imagecolorclosestalpha(GdImage $image, int $red, int $green, int $blue, function imagecolorexactalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {} -function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): true {} +function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void {} #ifdef PHP_WIN32 @@ -663,23 +663,23 @@ function imagecolorsforindex(GdImage $image, int $color): array {} function imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma): true {} -function imagesetpixel(GdImage $image, int $x, int $y, int $color): true {} +function imagesetpixel(GdImage $image, int $x, int $y, int $color): void {} -function imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} +function imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): void {} -function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} +function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): void {} -function imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} +function imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): void {} -function imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): true {} +function imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): void {} -function imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): true {} +function imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): void {} -function imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): true {} +function imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): void {} -function imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color): true {} +function imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color): void {} -function imagefill(GdImage $image, int $x, int $y, int $color): true {} +function imagefill(GdImage $image, int $x, int $y, int $color): void {} function imagecolorstotal(GdImage $image): int {} @@ -697,27 +697,27 @@ function imagefontwidth(GdFont|int $font): int {} function imagefontheight(GdFont|int $font): int {} -function imagechar(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): true {} +function imagechar(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): void {} -function imagecharup(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): true {} +function imagecharup(GdImage $image, GdFont|int $font, int $x, int $y, string $char, int $color): void {} -function imagestring(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): true {} +function imagestring(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): void {} -function imagestringup(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): true {} +function imagestringup(GdImage $image, GdFont|int $font, int $x, int $y, string $string, int $color): void {} -function imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): true {} +function imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): void {} -function imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): true {} +function imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void {} -function imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): true {} +function imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): void {} -function imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): true {} +function imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): void {} function imagesx(GdImage $image): int {} function imagesy(GdImage $image): int {} -function imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2): true {} +function imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2): void {} /** * @return array @@ -756,9 +756,9 @@ function imagefilter(GdImage $image, int $filter, ...$args): bool {} function imageconvolution(GdImage $image, array $matrix, float $divisor, float $offset): bool {} -function imageflip(GdImage $image, int $mode): true {} +function imageflip(GdImage $image, int $mode): void {} -function imageantialias(GdImage $image, bool $enable): true {} +function imageantialias(GdImage $image, bool $enable): void {} /** @refcount 1 */ function imagecrop(GdImage $image, array $rectangle): GdImage|false {} diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h index 5cf4f2f29a9bd..a5452833c6f1c 100644 --- a/ext/gd/gd_arginfo.h +++ b/ext/gd/gd_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 94822f6472750c646fc138f383278ca692b39d27 */ + * Stub hash: 99ff034c826a6d392267f0b0b79ebb5a31bbb014 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -35,12 +35,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolormatch, 0, 2, IS_TRUE, ZEND_ARG_OBJ_INFO(0, image2, GdImage, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetthickness, 0, 2, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetthickness, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, thickness, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0) @@ -49,7 +49,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledellipse, 0, 6, IS_TRU ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0) @@ -61,14 +61,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilledarc, 0, 9, IS_TRUE, 0 ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagealphablending, 0, 2, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagealphablending, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_imagesavealpha arginfo_imagealphablending -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagelayereffect, 0, 2, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagelayereffect, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, effect, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -93,7 +93,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagecolorexactalpha arginfo_imagecolorresolvealpha -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopyresampled, 0, 10, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopyresampled, 0, 10, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0) @@ -334,14 +334,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagegammacorrect, 0, 3, IS_TRUE ZEND_ARG_TYPE_INFO(0, output_gamma, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetpixel, 0, 4, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetpixel, 0, 4, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageline, 0, 6, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageline, 0, 6, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y1, IS_LONG, 0) @@ -356,7 +356,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagefilledrectangle arginfo_imageline -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagearc, 0, 8, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagearc, 0, 8, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, center_x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, center_y, IS_LONG, 0) @@ -369,7 +369,7 @@ ZEND_END_ARG_INFO() #define arginfo_imageellipse arginfo_imagefilledellipse -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilltoborder, 0, 5, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilltoborder, 0, 5, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) @@ -410,7 +410,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagefontheight arginfo_imagefontwidth -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagechar, 0, 6, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagechar, 0, 6, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_OBJ_TYPE_MASK(0, font, GdFont, MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) @@ -421,7 +421,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagecharup arginfo_imagechar -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagestring, 0, 6, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagestring, 0, 6, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_OBJ_TYPE_MASK(0, font, GdFont, MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) @@ -432,7 +432,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagestringup arginfo_imagestring -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0) @@ -443,7 +443,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopy, 0, 8, IS_TRUE, 0) ZEND_ARG_TYPE_INFO(0, src_height, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopymerge, 0, 9, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecopymerge, 0, 9, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, dst_image, GdImage, 0) ZEND_ARG_OBJ_INFO(0, src_image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, dst_x, IS_LONG, 0) @@ -463,7 +463,7 @@ ZEND_END_ARG_INFO() #define arginfo_imagesy arginfo_imagecolorstotal -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetclip, 0, 5, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagesetclip, 0, 5, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, x1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, y1, IS_LONG, 0) @@ -514,7 +514,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageconvolution, 0, 4, _IS_BOOL ZEND_ARG_TYPE_INFO(0, offset, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageflip, 0, 2, IS_TRUE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageflip, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) ZEND_END_ARG_INFO() From febd58ddce49befe5576467fb16c8ee0367d96f0 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 25 May 2025 12:23:18 +0100 Subject: [PATCH 2/3] fix forgotten change and tests --- ext/gd/gd.c | 2 -- ext/gd/tests/imageantialias_error2.phpt | 3 +-- ext/gd/tests/imagecopymerge_basic.phpt | 3 +-- ext/gd/tests/imagecopymergegray_basic.phpt | 3 +-- ext/gd/tests/imagelayereffect_basic.phpt | 4 +--- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 424eb0dde7988..c34a7299b6121 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1073,8 +1073,6 @@ PHP_FUNCTION(imagecopyresampled) dstW = DW; gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - - RETURN_TRUE; } /* }}} */ diff --git a/ext/gd/tests/imageantialias_error2.phpt b/ext/gd/tests/imageantialias_error2.phpt index 40f4d64a12b6e..95d81a00102f6 100644 --- a/ext/gd/tests/imageantialias_error2.phpt +++ b/ext/gd/tests/imageantialias_error2.phpt @@ -15,7 +15,6 @@ This test is failing due to this wrogn check */ $image = imagecreatetruecolor(180, 30); -var_dump(imageantialias($image, 'wrong param')); // 'wrogn param' is converted to true +imageantialias($image, 'wrong param'); ?> --EXPECT-- -bool(true) diff --git a/ext/gd/tests/imagecopymerge_basic.phpt b/ext/gd/tests/imagecopymerge_basic.phpt index b40e2d63cdb2f..4af504a7138ad 100644 --- a/ext/gd/tests/imagecopymerge_basic.phpt +++ b/ext/gd/tests/imagecopymerge_basic.phpt @@ -20,7 +20,7 @@ $color_src = imagecolorallocate($src, 255, 255, 255); imagefill($des, 0, 0, $color_des); imagefill($src, 0, 0, $color_src); -var_dump(imagecopymerge($des, $src, 20, 20, 0, 0, 50, 50, 75)); +imagecopymerge($des, $src, 20, 20, 0, 0, 50, 50, 75); $color = imagecolorat($des, 30, 30); $rgb = imagecolorsforindex($des, $color); @@ -28,5 +28,4 @@ echo $rgb['red'], ", ", $rgb['green'], ", ", $rgb['blue'], "\n"; ?> --EXPECT-- -bool(true) 203, 203, 241 diff --git a/ext/gd/tests/imagecopymergegray_basic.phpt b/ext/gd/tests/imagecopymergegray_basic.phpt index d0213c7aba724..bc0282ef76839 100644 --- a/ext/gd/tests/imagecopymergegray_basic.phpt +++ b/ext/gd/tests/imagecopymergegray_basic.phpt @@ -17,7 +17,7 @@ $color_src = imagecolorallocate($src, 255, 255, 0); imagefill($des, 0, 0, $color_des); imagefill($src, 0, 0, $color_src); -var_dump(imagecopymergegray($des, $src, 20, 20, 0, 0, 50, 50, 75)); +imagecopymergegray($des, $src, 20, 20, 0, 0, 50, 50, 75); $color = imagecolorat($des, 30, 30); $rgb = imagecolorsforindex($des, $color); @@ -25,5 +25,4 @@ echo $rgb['red'], ", ", $rgb['green'], ", ", $rgb['blue'], "\n"; ?> --EXPECT-- -bool(true) 208, 208, 16 diff --git a/ext/gd/tests/imagelayereffect_basic.phpt b/ext/gd/tests/imagelayereffect_basic.phpt index 2480110669c62..9afe97bb2bedf 100644 --- a/ext/gd/tests/imagelayereffect_basic.phpt +++ b/ext/gd/tests/imagelayereffect_basic.phpt @@ -13,12 +13,10 @@ gd --EXPECT-- -bool(true) The images are equal. From de84dadef88796ac68e50d994b16bc33a0591dcb Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 25 May 2025 13:01:21 +0100 Subject: [PATCH 3/3] little note --- UPGRADING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UPGRADING b/UPGRADING index ecefb0eca867a..fb4fda8f1bd60 100644 --- a/UPGRADING +++ b/UPGRADING @@ -229,6 +229,14 @@ PHP 8.5 UPGRADE NOTES 5. Changed Functions ======================================== +- GD: + . imagethickness, imagefilledeclipse, imagefilledarc, imagealphablending, + imagesavealpha, imagelayereffect, imagecopyresampled, imagesetpixel, + imageline, imagedashedline, imagerectangle, imagefilledrectangle, + imagearc, imageellipse, imagefill, imagechar*, iamgestring*, + imagecopy, imagecopymerge, imagecopymergegray, imagecopyresized, + imagesetclip, imgeflip and imageantialias no return true. + - Intl: . IntlDateFormatter::setTimeZone()/datefmt_set_timezone() throws an IntlException on uninitialised classes/clone failures.