xref: /PHP-8.2/ext/imap/tests/bug80438.phpt (revision b5a14e6c)
1--TEST--
2Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
3--EXTENSIONS--
4imap
5--SKIPIF--
6<?php
7require_once(__DIR__.'/setup/skipif.inc');
8?>
9--FILE--
10<?php
11
12require_once __DIR__.'/setup/imap_include.inc';
13
14// create a new mailbox and add 10 new messages to it
15$mail_box = setup_test_mailbox_for_uid_tests('bug80438');
16
17$message_number_array = imap_search($mail_box, 'ALL', SE_UID);
18
19var_dump($message_number_array);
20
21foreach ($message_number_array as $message_unique_id)
22{
23    echo 'Unique ID: ';
24    var_dump($message_unique_id);
25    echo 'Ordered message number: ';
26    var_dump(imap_msgno($mail_box, $message_unique_id));
27}
28
29imap_close($mail_box);
30
31?>
32--CLEAN--
33<?php
34$mailbox_suffix = 'bug80438';
35require_once __DIR__.'/setup/clean.inc';
36?>
37--EXPECT--
38Create a temporary mailbox and add 10 msgs
39New mailbox created
40Delete 4 messages for Unique ID generation
41array(6) {
42  [0]=>
43  int(1)
44  [1]=>
45  int(2)
46  [2]=>
47  int(7)
48  [3]=>
49  int(8)
50  [4]=>
51  int(9)
52  [5]=>
53  int(10)
54}
55Unique ID: int(1)
56Ordered message number: int(1)
57Unique ID: int(2)
58Ordered message number: int(2)
59Unique ID: int(7)
60Ordered message number: int(3)
61Unique ID: int(8)
62Ordered message number: int(4)
63Unique ID: int(9)
64Ordered message number: int(5)
65Unique ID: int(10)
66Ordered message number: int(6)
67