1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
--TEST--
Test fseek(), ftell() & rewind() functions : error conditions - ftell()
--FILE--
<?php
echo "*** Testing ftell() : error conditions ***\n";
// ftell on a file handle which is already closed
echo "-- Testing ftell with closed/unset file handle --\n";
$fp = fopen(__FILE__, "r");
fclose($fp);
try {
var_dump(ftell($fp));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
*** Testing ftell() : error conditions ***
-- Testing ftell with closed/unset file handle --
ftell(): supplied resource is not a valid stream resource
Done
|