mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Deprecate $num_points parameter of image(open|filled)polygon
Cf. <https://wiki.php.net/rfc/deprecations_php_8_1#num_points_parameter_of_image_open_filled_polygon>. Co-authored-by: Máté Kocsis <kocsismate@woohoolabs.com> Co-authored-by: George Peter Banyard <7906688+Girgias@users.noreply.github.com> Closes GH-6789.
This commit is contained in:
parent
4b3615a33f
commit
e1285c4aa5
@ -370,6 +370,9 @@ PHP 8.1 UPGRADE NOTES
|
||||
. The filter.default ini setting is deprecated.
|
||||
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
|
||||
|
||||
- GD:
|
||||
. The $num_points parameter of image(open|filled)polygon has been deprecated.
|
||||
|
||||
- Hash:
|
||||
. The mhash(), mhash_keygen_s2k(), mhash_count(), mhash_get_block_size() and
|
||||
mhash_get_hash_name() functions are deprecated. Use the hash_*() APIs
|
||||
|
@ -2726,6 +2726,8 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
|
||||
RETURN_THROWS();
|
||||
}
|
||||
NPOINTS /= 2;
|
||||
} else {
|
||||
php_error_docref(NULL, E_DEPRECATED, "Using the $num_points parameter is deprecated");
|
||||
}
|
||||
|
||||
im = php_gd_libgdimageptr_from_zval_p(IM);
|
||||
|
@ -14,6 +14,9 @@ trycatch_dump(
|
||||
fn () => imagepolygon($g, array(200,10, 200,100, 280,100), 2, $fgnd)
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Deprecated: imagefilledpolygon(): Using the $num_points parameter is deprecated in %s on line %d
|
||||
!! [ValueError] imagefilledpolygon(): Argument #3 ($num_points_or_color) must be greater than or equal to 3
|
||||
|
||||
Deprecated: imagepolygon(): Using the $num_points parameter is deprecated in %s on line %d
|
||||
!! [ValueError] imagepolygon(): Argument #3 ($num_points_or_color) must be greater than or equal to 3
|
||||
|
Loading…
Reference in New Issue
Block a user