xref: /PHP-8.3/ext/gd/tests/gh16260.phpt (revision 2d05da2e)
1--TEST--
2GH-16260 (Overflow/underflow on imagerotate degrees argument)
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7$im = imagecreatetruecolor(10,10);
8
9try {
10	imagerotate($im, PHP_INT_MIN, 0);
11} catch (\ValueError $e) {
12	echo $e->getMessage() . PHP_EOL;
13}
14
15try {
16	imagerotate($im, PHP_INT_MAX, 0);
17} catch (\ValueError $e) {
18	echo $e->getMessage();
19}
20--EXPECTF--
21imagerotate(): Argument #2 ($angle) must be between %s and %s
22imagerotate(): Argument #2 ($angle) must be between %s and %s
23