1--TEST-- 2Bug #77272 (imagescale() may return image resource on failure) 3--INI-- 4memory_limit=-1 5--SKIPIF-- 6<?php 7if (!extension_loaded('gd')) die('skip gd extension not available'); 8if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released'); 9if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); 10?> 11--FILE-- 12<?php 13$img = imagecreate(2**28, 1); 14var_dump(imagescale($img, 1, 1, IMG_TRIANGLE)); 15?> 16--EXPECTF-- 17Warning: imagescale():%S Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully 18 in %s on line %d 19bool(false) 20