1--TEST--
2posix_ttyname(): casting stream does not emit data loss and should not emit warnings
3--EXTENSIONS--
4posix
5--SKIPIF--
6<?php
7require __DIR__ . '/../../standard/tests/http/server.inc'; http_server_skipif();
8?>
9--INI--
10allow_url_fopen=1
11--FILE--
12<?php
13
14require __DIR__ . '/../../standard/tests/http/server.inc';
15
16$responses = array(
17    "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\nSome: Header\r\n\r\nBody",
18);
19
20['pid' => $pid, 'uri' => $uri] = http_server($responses, $output);
21
22/* Note: the warning is bogus in this case as no data actually gets lost,
23 * but this checks that stream casting works */
24$handle = fopen($uri, 'r');
25var_dump(posix_ttyname($handle));
26var_dump(fread($handle, 20));
27fclose($handle);
28
29http_server_kill($pid);
30?>
31--EXPECT--
32bool(false)
33string(4) "Body"
34