2 Test imap_close() function : usage variations - different streams
5 extension_loaded('imap') or die('skip imap extension not available in this build');
9 /* Prototype : bool imap_close(resource $stream_id [, int $options])
10 * Description: Close an IMAP stream
11 * Source code: ext/imap/php_imap.c
15 * Pass different stream types to imap_close() to test whether it can close them
18 echo "*** Testing imap_close() : usage variations ***\n";
20 echo "\n-- File Resource opened with fopen() --\n";
21 var_dump($file_handle = fopen(__FILE__, 'r'));
22 var_dump(imap_close($file_handle));
23 var_dump($file_handle);
25 echo "\n-- Directory Resource opened with opendir() --\n";
26 var_dump($dir_handle = opendir(dirname(__FILE__)));
27 var_dump(imap_close($dir_handle));
28 var_dump($dir_handle);
32 *** Testing imap_close() : usage variations ***
34 -- File Resource opened with fopen() --
35 resource(%d) of type (stream)
37 Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d
39 resource(%d) of type (stream)
41 -- Directory Resource opened with opendir() --
42 resource(%d) of type (stream)
44 Warning: imap_close(): supplied resource is not a valid imap resource in %s on line %d
46 resource(%d) of type (stream)