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