2 Test imap_fetchheader() function : usage variations - FT_UID option
5 require_once(dirname(__FILE__).'/skipif.inc');
9 /* Prototype : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options])
10 * Description: Get the full unfiltered header for a message
11 * Source code: ext/imap/php_imap.c
15 * Test if FT_UID is set by passing the following as $options argument to imap_fetchheader():
16 * 1. values that equate to 1
17 * 2. Minimum and maximum PHP values
20 echo "*** Testing imap_fetchheader() : usage variations ***\n";
22 require_once(dirname(__FILE__).'/imap_include.inc');
24 // Initialise required variables
25 $stream_id = setup_test_mailbox('', 1); // set up temporary mailbox with one simple message
27 $msg_uid = imap_uid($stream_id, $msg_no);
29 $options = array ('1', true,
30 1.000000000000001, 0.00001e5,
31 PHP_INT_MAX, -PHP_INT_MAX);
33 // iterate over each element of $options array to test whether FT_UID is set
35 imap_check($stream_id);
36 foreach($options as $option) {
37 echo "\n-- Iteration $iterator --\n";
38 if(is_string(imap_fetchheader($stream_id, $msg_uid, $option))) {
39 echo "FT_UID valid\n";
41 echo "FT_UID not valid\n";
49 require_once(dirname(__FILE__).'/clean.inc');
52 *** Testing imap_fetchheader() : usage variations ***
53 Create a temporary mailbox and add 1 msgs
54 .. mailbox '{%s}%s' created
70 Warning: imap_fetchheader(): invalid value for the options parameter in %s on line %d
75 Warning: imap_fetchheader(): invalid value for the options parameter in %s on line %d