xref: /PHP-7.2/ext/standard/tests/file/bug53241.phpt (revision 3f72c77c)
1--TEST--
2Bug #53241 (stream casting that relies on fdopen/fopencookie fails with 'xb' mode)
3--SKIPIF--
4<?php
5/* unfortunately no standard function does a cast to FILE*, so we need
6 * curl to test this */
7if (!extension_loaded("curl")) exit("skip curl extension not loaded");
8--FILE--
9<?php
10$fn = __DIR__ . "/test.tmp";
11@unlink($fn);
12$fh = fopen($fn, 'xb');
13$ch = curl_init('http://www.yahoo.com/');
14var_dump(curl_setopt($ch, CURLOPT_FILE, $fh));
15echo "Done.\n";
16--CLEAN--
17<?php
18$fn = __DIR__ . "/test.tmp";
19@unlink($fn);
20?>
21--EXPECT--
22bool(true)
23Done.
24