xref: /PHP-8.2/ext/gd/tests/imagecreate_error.phpt (revision a375d547)
1--TEST--
2Testing imagecreate(): error on out of bound parameters
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7    if (!function_exists("imagecreate")) die("skip GD Version not compatible");
8?>
9--FILE--
10<?php
11
12require __DIR__ . '/func.inc';
13
14trycatch_dump(
15    fn() => imagecreate(-1, 30),
16    fn() => imagecreate(30, -1)
17);
18
19?>
20--EXPECT--
21!! [ValueError] imagecreate(): Argument #1 ($width) must be greater than 0
22!! [ValueError] imagecreate(): Argument #2 ($height) must be greater than 0
23