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

http://github.com/facebook/hiphop-php · PHP · 21 lines · 17 code · 4 blank · 0 comment · 0 complexity · e638f278226cebc045e128bd8c3df521 MD5 · raw file

  1. <?hh <<__EntryPoint>> function main(): void {
  2. $image=imagecreatetruecolor(400, 400);
  3. $white = imagecolorallocate($image, 255, 255, 255);
  4. $black = imagecolorallocate($image, 0, 0, 0);
  5. $red = imagecolorallocate($image, 255, 0, 0);
  6. imagefill($image, 0, 0, $white);
  7. imagesetthickness($image, 10);
  8. imageline($image, 200, 0, 200, 400, $black);
  9. imageline($image, 0, 200, 400, 200, $black);
  10. imageline($image, 0, 0, 392, 392, $black);
  11. imagesetthickness($image, 1);
  12. imageline($image, 200, 0, 200, 400, $red);
  13. imageline($image, 0, 200, 400, 200, $red);
  14. imageline($image, 0, 0, 392, 392, $red);
  15. print_r(imagecolorat($image, 195, 0));
  16. print_r(imagecolorat($image, 0, 195));
  17. }