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