summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/php_fd_wrapper_04.phpt
blob: 1c5defdaefd0c9032b318feb667e077f556aa3c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
php://fd wrapper: invalid file descriptor
--SKIPIF--
<?php include('skipif.inc');
if(substr(PHP_OS, 0, 3) == "WIN")
	die("skip Not for Windows");

//we'd need a release and a test variation for windows, because in debug builds we get this message:
//Warning: Invalid parameter detected in CRT function '_dup' (f:\dd\vctools\crt_bld\self_x86\crt\src\dup.c:52)
//I greped the CRT sources and found no function capable of validating a file descriptor

--FILE--
<?php
fopen("php://fd/12", "w");

echo "\nDone.\n";
--EXPECTF--
Warning: fopen(php://fd/12): failed to open stream: Error duping file descriptor 12; possibly it doesn't exist: [9]: %s in %s on line %d

Done.