summaryrefslogtreecommitdiff
path: root/ext/gd/tests/imagecreate_error.phpt
blob: 1e068205e95b0cca6291330a35ff910e54db6a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Testing imagecreate(): error on out of bound parameters
--SKIPIF--
<?php
    if (!extension_loaded("gd")) die("skip GD not present");
    if (!function_exists("imagecreate")) die("skip GD Version not compatible");
?>
--FILE--
<?php

require __DIR__ . '/func.inc';

trycatch_dump(
    fn() => imagecreate(-1, 30),
    fn() => imagecreate(30, -1)
);

?>
--EXPECT--
!! [ValueError] imagecreate(): Argument #1 ($width) must be greater than 0
!! [ValueError] imagecreate(): Argument #2 ($height) must be greater than 0