Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
15 changes: 15 additions & 0 deletions ext/gd/tests/imageaffine_element_type_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
imageaffine(): the TypeError for an invalid element names the $affine argument
--EXTENSIONS--
gd
--FILE--
<?php
$im = imagecreatetruecolor(20, 20);
try {
imageaffine($im, [1, 0, null, 1, 0, 0]);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
TypeError: imageaffine(): Argument #2 ($affine) contains invalid type for element 2
Loading