xref: /PHP-7.3/ext/gd/tests/bug79615.phpt (revision d4bd6fb4)
1--TEST--
2Bug #79615 (Wrong GIF header written in GD GIFEncode)
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6?>
7--FILE--
8<?php
9$im = imagecreate(3, 3); // 3x3, 9 colors, 4 bits per pixel
10for ($x = 0; $x < 3; $x++) {
11    for ($y = 0; $y < 3; $y++) {
12        imagesetpixel($im, $x, $y, imagecolorallocate($im, $x, $y, 0));
13    }
14}
15ob_start();
16imagegif($im);
17echo decbin(ord(ob_get_clean()[0xA]));
18?>
19--EXPECT--
2010110011
21