* Source code: ext/imap/php_imap.c
 */
/*
 * Pass a multipart message to imap_fetch_overview() to test the contents of returned array
 */
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
require_once dirname(__FILE__) . '/imap_include.inc';
$stream_id = setup_test_mailbox('', 0, $mailbox);
// setup temp mailbox
create_multipart_message($stream_id, $mailbox);
// refresh msg numbers
imap_check($stream_id);
$msg_no = 1;
$a = imap_fetch_overview($stream_id, $msg_no);
echo "\n--> Object #1\n";
displayOverviewFields($a[0]);
/**
 * Create a multipart message with subparts
 *
 * @param resource $imap_stream
 * @param string $mailbox
 */
function create_multipart_message($imap_stream, $mailbox)
{
    global $users, $domain;
    $envelope["from"] = "*****@*****.**";
    $envelope["to"] = "{$users['0']}@{$domain}";
    $envelope["subject"] = "Test msg 1";
    $part1["type"] = TYPEMULTIPART;
    $part1["subtype"] = "mixed";
    $part2["type"] = TYPETEXT;
 * of the given message sequence 
 * Source code: ext/imap/php_imap.c
 */
/*
 * Pass different sequences/msg numbers as $msg_no argument to test behaviour
 * of imap_fetch_overview()
 */
echo "*** Testing imap_fetch_overview() : usage variations ***\n";
require_once dirname(__FILE__) . '/imap_include.inc';
$stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple');
// set up temp mailbox with 3 msgs
$sequences = array(0, 4, '4', '2', '1,3', '1, 2', '1:3');
// pass uid without setting FT_UID option
foreach ($sequences as $msg_no) {
    echo "\n-- \$msg_no is {$msg_no} --\n";
    $overview = imap_fetch_overview($stream_id, $msg_no);
    if (!$overview) {
        echo imap_last_error() . "\n";
    } else {
        foreach ($overview as $ov) {
            echo "\n";
            displayOverviewFields($ov);
        }
    }
}
// clear error stack
imap_errors();
?>
===DONE===
<?php 
require_once dirname(__FILE__) . '/clean.inc';
        return "Class A object";
    }
}
// heredoc string
$heredoc = <<<EOT
hello world
EOT;
// get a resource variable
$fp = fopen(__FILE__, "r");
// unexpected values to be passed to <<<ARGUMENT HERE>>> argument
$inputs = array(0, 1, 12345, -2345, 10.5, -10.5, 123456789000.0, 1.23456789E-9, 0.5, NULL, null, true, false, TRUE, FALSE, "", '', array(), "string", 'string', $heredoc, new classA(), @$undefined_var, @$unset_var, $fp);
// loop through each element of $inputs to check the behavior of imap_fetch_overview()
$iterator = 1;
foreach ($inputs as $input) {
    echo "\n-- Testing with second argument value: ";
    var_dump($input);
    $overview = imap_fetch_overview($stream_id, $input);
    if (!$overview) {
        echo imap_last_error() . "\n";
    } else {
        displayOverviewFields($overview[0]);
    }
    $iterator++;
}
fclose($fp);
// clear the error stack
imap_errors();
?>
===DONE===
<?php 
require_once dirname(__FILE__) . '/clean.inc';