1--TEST--
2Test fopen() function : check fopen()ed descriptor is usable after the fs object is removed
3--FILE--
4<?php
5
6var_dump(
7	$p = __DIR__ . DIRECTORY_SEPARATOR . 'tututu',
8	$f = fopen($p, 'w+'),
9	unlink($p),
10	file_exists($p),
11	fwrite($f, 'hello'),
12	fseek($f, 0),
13	fread($f, 16),
14	fwrite($f, 'world'),
15	fseek($f, 0),
16	fread($f, 16),
17	fclose($f)
18);
19
20?>
21===DONE===
22--EXPECTF--
23string(%d) "%stututu"
24resource(%s) of type (Unknown)
25bool(true)
26bool(false)
27int(5)
28int(0)
29string(5) "hello"
30int(5)
31int(0)
32string(10) "helloworld"
33bool(true)
34===DONE===
35