From b43c87fcd064bf7df66973f0f51e655b50eaaf7e Mon Sep 17 00:00:00 2001 From: lacatoire Date: Fri, 16 Oct 2026 11:05:08 +0200 Subject: [PATCH] Fix the argument named by the imageaffine() element TypeError --- ext/gd/gd.c | 2 +- ext/gd/tests/imageaffine_element_type_error.phpt | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ext/gd/tests/imageaffine_element_type_error.phpt diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 21fb90c3b4d1..9f6e38a2e78d 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -4142,7 +4142,7 @@ PHP_FUNCTION(imageaffine) } break; default: - zend_argument_type_error(3, "contains invalid type for element %i", i); + zend_argument_type_error(2, "contains invalid type for element %i", i); RETURN_THROWS(); } } diff --git a/ext/gd/tests/imageaffine_element_type_error.phpt b/ext/gd/tests/imageaffine_element_type_error.phpt new file mode 100644 index 000000000000..e4cf2cc4336f --- /dev/null +++ b/ext/gd/tests/imageaffine_element_type_error.phpt @@ -0,0 +1,15 @@ +--TEST-- +imageaffine(): the TypeError for an invalid element names the $affine argument +--EXTENSIONS-- +gd +--FILE-- +getMessage(), "\n"; +} +?> +--EXPECT-- +TypeError: imageaffine(): Argument #2 ($affine) contains invalid type for element 2