1--TEST--
2Wrong image resolution
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7if (PHP_INT_SIZE != 8) die("skip on non 64 bits architectures");
8?>
9--FILE--
10<?php
11$filename = __DIR__ . DIRECTORY_SEPARATOR . 'imageresolution_png.png';
12
13$exp = imagecreate(100, 100);
14imagecolorallocate($exp, 255, 127, 64);
15
16$res = imageresolution($exp);
17
18try {
19	imageresolution($exp, PHP_INT_MAX);
20} catch (\ValueError $e) {
21	echo $e->getMessage() . PHP_EOL;
22}
23try {
24	imageresolution($exp, 127, -PHP_INT_MAX);
25} catch (\ValueError $e) {
26	echo $e->getMessage() . PHP_EOL;
27}
28imageresolution($exp, 0, 0);
29var_dump(imageresolution($exp) == $res);
30?>
31--EXPECTF--
32imageresolution(): Argument #2 ($resolution_x) must be between 0 and %d
33imageresolution(): Argument #3 ($resolution_y) must be between 0 and %d
34bool(true)
35