1--TEST--
2imagecolorset() parameters errors
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7
8require __DIR__ . '/func.inc';
9
10$im = imagecreate(5, 5);
11
12$c = imagecolorallocatealpha($im, 3, 4, 5, 6);
13
14trycatch_dump(
15    fn() => imagecolorset($im, $c, -3, 4, 5, 6),
16    fn() => imagecolorset($im, $c, 3, -4, 5, 6),
17    fn() => imagecolorset($im, $c, 3, 4, -5, 6),
18    fn() => imagecolorset($im, $c, 3, 4, 5, -6),
19);
20
21?>
22--EXPECT--
23!! [ValueError] imagecolorset(): Argument #3 ($red) must be between 0 and 255 (inclusive)
24!! [ValueError] imagecolorset(): Argument #4 ($green) must be between 0 and 255 (inclusive)
25!! [ValueError] imagecolorset(): Argument #5 ($blue) must be between 0 and 255 (inclusive)
26!! [ValueError] imagecolorset(): Argument #6 ($alpha) must be between 0 and 127 (inclusive)
27