1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 04:02:19 +02:00
Files
archived-php-src/ext/gd/tests/imagecreate_error.phpt
Peter Cowburn a43679632b raise ValueError from imagecreate/imagecreatetruecolor
Raise a ValueError instead of a plain Error when calling imagecreate()
or imagecreatetruecolor() with too big or small values for the width or
height arguments.
2019-09-09 21:06:00 +01:00

22 lines
445 B
PHP

--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] Invalid width (x_size)
!! [ValueError] Invalid height (y_size)