xref: /PHP-5.5/ext/gd/tests/bug41442.phpt (revision 083844f8)
1--TEST--
2Bug #41442 (imagegd2() under output control)
3--SKIPIF--
4<?php
5	if (!extension_loaded('gd')) {
6		die("skip gd extension not available.");
7	}
8	if (!function_exists("imagegd2")) {
9		die("skip GD2 support unavailable");
10	}
11?>
12--FILE--
13<?php
14
15$str = file_get_contents(dirname(__FILE__).'/src.gd2');
16$res = imagecreatefromstring($str);
17
18/* string */
19ob_start();
20imagegd2($res);
21$str2 = ob_get_clean();
22var_dump(imagecreatefromstring($str2));
23
24/* file */
25$file = dirname(__FILE__)."/bug41442.gd2";
26imagegd2($res, $file);
27$str2 = file_get_contents($file);
28var_dump(imagecreatefromstring($str2));
29
30@unlink($file);
31
32echo "Done\n";
33?>
34--EXPECTF--
35resource(%d) of type (gd)
36resource(%d) of type (gd)
37Done
38