/hphp/test/zend/good/ext/gd/tests/bug66356.php
PHP | 22 lines | 11 code | 6 blank | 5 comment | 0 complexity | 05f571581f691045cd3461e5801b18ba MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh <<__EntryPoint>> function main(): void {
- $img = imagecreatetruecolor(10, 10);
- // POC #1
- var_dump(imagecrop($img, darray["x" => "a", "y" => 0, "width" => 10, "height" => 10]));
- $arr = darray["x" => "a", "y" => "12b", "width" => 10, "height" => 10];
- var_dump(imagecrop($img, $arr));
- print_r($arr);
- // POC #2
- var_dump(imagecrop($img, darray["x" => 0, "y" => 0, "width" => -1, "height" => 10]));
- // POC #3
- var_dump(imagecrop($img, darray["x" => -20, "y" => -20, "width" => 10, "height" => 10]));
- // POC #4
- var_dump(imagecrop($img, darray["x" => 0x7fffff00, "y" => 0, "width" => 10, "height" => 10]));
- // bug 66815
- var_dump(imagecrop($img, darray["x" => 0, "y" => 0, "width" => 65535, "height" => 65535]));
- }