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