diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 609a61ebc243c..5e331f2aa971e 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2673,6 +2673,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); diff --git a/ext/gd/tests/bug55005.phpt b/ext/gd/tests/bug55005.phpt index 4514b80fed3b5..0bcdb73c995ac 100644 --- a/ext/gd/tests/bug55005.phpt +++ b/ext/gd/tests/bug55005.phpt @@ -16,6 +16,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