PageRenderTime 54ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/ext/gd/tests/bug66356.php

http://github.com/facebook/hiphop-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
  1. <?hh <<__EntryPoint>> function main(): void {
  2. $img = imagecreatetruecolor(10, 10);
  3. // POC #1
  4. var_dump(imagecrop($img, darray["x" => "a", "y" => 0, "width" => 10, "height" => 10]));
  5. $arr = darray["x" => "a", "y" => "12b", "width" => 10, "height" => 10];
  6. var_dump(imagecrop($img, $arr));
  7. print_r($arr);
  8. // POC #2
  9. var_dump(imagecrop($img, darray["x" => 0, "y" => 0, "width" => -1, "height" => 10]));
  10. // POC #3
  11. var_dump(imagecrop($img, darray["x" => -20, "y" => -20, "width" => 10, "height" => 10]));
  12. // POC #4
  13. var_dump(imagecrop($img, darray["x" => 0x7fffff00, "y" => 0, "width" => 10, "height" => 10]));
  14. // bug 66815
  15. var_dump(imagecrop($img, darray["x" => 0, "y" => 0, "width" => 65535, "height" => 65535]));
  16. }