1--TEST--
2Test fgetc() function : usage variations - closed handle
3--FILE--
4<?php
5/* try reading a char using fgetc() using invalid handles
6    - closed file handle
7    - unset file handle
8*/
9
10// include the header for common test function
11include ("file.inc");
12
13echo "*** Testing fgetc() : usage variations ***\n";
14
15echo "-- Testing fgetc() with closed handle --\n";
16// open the file for reading
17$file_handle = fopen(__FILE__, "r");
18// close the file
19fclose($file_handle);
20
21// read from closed file
22try {
23    var_dump( fgetc($file_handle) );
24} catch (TypeError $e) {
25    echo $e->getMessage(), "\n";
26}
27
28echo "Done";
29?>
30--EXPECT--
31*** Testing fgetc() : usage variations ***
32-- Testing fgetc() with closed handle --
33fgetc(): supplied resource is not a valid stream resource
34Done
35