xref: /PHP-8.0/ext/gd/tests/bug41442.phpt (revision c5401854)
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(__DIR__.'/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 = __DIR__."/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--EXPECT--
35object(GdImage)#2 (0) {
36}
37object(GdImage)#2 (0) {
38}
39Done
40