diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 48e031ddec02..2506a33fe7c7 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -3634,8 +3634,7 @@ PHP_FUNCTION(imagescale) im = php_gd_libgdimageptr_from_zval_p(IM); if (tmp_h < 0 && tmp_w < 0) { - zend_value_error("$width and $height cannot be both negative"); - RETURN_THROWS(); + RETURN_FALSE; } if (tmp_h < 0 || tmp_w < 0) { diff --git a/ext/gd/tests/gh17703.phpt b/ext/gd/tests/gh17703.phpt index 39cc9a9d5552..512ced92cf47 100644 --- a/ext/gd/tests/gh17703.phpt +++ b/ext/gd/tests/gh17703.phpt @@ -7,11 +7,7 @@ gd $img = imagecreatetruecolor ( 256, 1); -try { - imagescale($img, -1, -1, 0); -} catch (\ValueError $e) { - echo $e->getMessage(); -} +var_dump(imagescale($img, -1, -1, 0)); ?> --EXPECT-- -$width and $height cannot be both negative +bool(false)