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--EXPECTF-- 22string(%d) "%stututu" 23resource(%s) of type (Unknown) 24bool(true) 25bool(false) 26int(5) 27int(0) 28string(5) "hello" 29int(5) 30int(0) 31string(10) "helloworld" 32bool(true) 33