diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-17 15:06:46 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-17 15:06:46 +0100 |
commit | db538775e16bdc154d195469d658f6bee9809c5a (patch) | |
tree | 67a6c0cceee80b0215eba90064b104d1fc6f58b2 /ext/gd | |
parent | 8f0ca7c16cf13a9b3856e517d5394b801c1bdffc (diff) | |
parent | c17434429d4de525a8eb8c33af77324e03a14684 (diff) | |
download | php-git-db538775e16bdc154d195469d658f6bee9809c5a.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Return bool from imageinterlace()
Diffstat (limited to 'ext/gd')
-rw-r--r-- | ext/gd/gd.c | 2 | ||||
-rw-r--r-- | ext/gd/gd.stub.php | 2 | ||||
-rw-r--r-- | ext/gd/gd_arginfo.h | 4 | ||||
-rw-r--r-- | ext/gd/tests/bug77700.phpt | 4 | ||||
-rw-r--r-- | ext/gd/tests/imageinterlace_basic.phpt | 2 | ||||
-rw-r--r-- | ext/gd/tests/imageinterlace_variation1.phpt | 6 | ||||
-rw-r--r-- | ext/gd/tests/imageinterlace_variation2.phpt | 8 |
7 files changed, 14 insertions, 14 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 0b680107fd..fe672a1aee 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2643,7 +2643,7 @@ PHP_FUNCTION(imageinterlace) gdImageInterlace(im, INT); } - RETURN_LONG(gdImageGetInterlaced(im)); + RETURN_BOOL(gdImageGetInterlaced(im)); } /* }}} */ diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php index e22337592c..531ccb7989 100644 --- a/ext/gd/gd.stub.php +++ b/ext/gd/gd.stub.php @@ -180,7 +180,7 @@ function imagecolorstotal(GdImage $image): int {} function imagecolortransparent(GdImage $image, ?int $color = null): ?int {} -function imageinterlace(GdImage $image, ?bool $enable = null): ?int {} +function imageinterlace(GdImage $image, ?bool $enable = null): bool {} function imagepolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {} diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h index 92aeba7716..fdc509901c 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: 884e30d9f263c5873d15cec9c2d2f1fef5b75fe6 */ + * Stub hash: a2e5f8b612433e77d623bbab6b1d3d32fca7966c */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -363,7 +363,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagecolortransparent, 0, 1, IS_ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_LONG, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageinterlace, 0, 1, IS_LONG, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageinterlace, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, image, GdImage, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/gd/tests/bug77700.phpt b/ext/gd/tests/bug77700.phpt index 27b93cf0d0..a14a2259eb 100644 --- a/ext/gd/tests/bug77700.phpt +++ b/ext/gd/tests/bug77700.phpt @@ -8,14 +8,14 @@ if (!extension_loaded('gd')) die('skip gd extension not available'); <?php $im = imagecreatetruecolor(10, 10); imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255)); -imageinterlace($im, 1); +imageinterlace($im, true); imagegif($im, __DIR__ . 'bug77700.gif'); $im = imagecreatefromgif(__DIR__ . 'bug77700.gif'); var_dump(imageinterlace($im)); ?> --EXPECT-- -int(1) +bool(true) --CLEAN-- <?php unlink(__DIR__ . 'bug77700.gif'); diff --git a/ext/gd/tests/imageinterlace_basic.phpt b/ext/gd/tests/imageinterlace_basic.phpt index 62d99bcf91..5ea674e606 100644 --- a/ext/gd/tests/imageinterlace_basic.phpt +++ b/ext/gd/tests/imageinterlace_basic.phpt @@ -14,4 +14,4 @@ $image = imagecreatetruecolor(100, 100); var_dump(imageinterlace($image)); ?> --EXPECT-- -int(0) +bool(false) diff --git a/ext/gd/tests/imageinterlace_variation1.phpt b/ext/gd/tests/imageinterlace_variation1.phpt index d8eb7972fa..477aa9d259 100644 --- a/ext/gd/tests/imageinterlace_variation1.phpt +++ b/ext/gd/tests/imageinterlace_variation1.phpt @@ -12,9 +12,9 @@ if (!extension_loaded("gd")) die("skip GD not present"); $image = imagecreatetruecolor(100, 100); -var_dump(imageinterlace($image, 1)); +var_dump(imageinterlace($image, true)); var_dump(imageinterlace($image)); ?> --EXPECT-- -int(1) -int(1) +bool(true) +bool(true) diff --git a/ext/gd/tests/imageinterlace_variation2.phpt b/ext/gd/tests/imageinterlace_variation2.phpt index f1ee51502d..37370cec03 100644 --- a/ext/gd/tests/imageinterlace_variation2.phpt +++ b/ext/gd/tests/imageinterlace_variation2.phpt @@ -13,12 +13,12 @@ if (!extension_loaded("gd")) die("skip GD not present"); $image = imagecreatetruecolor(100, 100); //setting the interlace bit to on -imageinterlace($image, 1); +imageinterlace($image, true); //setting de interlace bit to off -var_dump(imageinterlace($image, 0)); +var_dump(imageinterlace($image, false)); var_dump(imageinterlace($image)); ?> --EXPECT-- -int(0) -int(0) +bool(false) +bool(false) |