xref: /PHP-8.2/ext/imap/tests/bug45705_2.phpt (revision 39131219)
1--TEST--
2Bug #45705 test #2 (imap rfc822_parse_adrlist() modifies passed address parameter)
3--EXTENSIONS--
4imap
5--FILE--
6<?php
7
8$envelope = array('return_path' => 'John Doe <john@example.com>',
9                  'from'        => 'John Doe <john@example.com>',
10                  'reply_to'    => 'John Doe <john@example.com>',
11                  'to'          => 'John Doe <john@example.com>',
12                  'cc'          => 'John Doe <john@example.com>',
13                  'bcc'         => 'John Doe <john@example.com>',
14);
15
16var_dump($envelope);
17imap_mail_compose($envelope, [1 => ['cc' => 'Steve Doe <steve@example.com>',]]);
18var_dump($envelope);
19
20?>
21--EXPECT--
22array(6) {
23  ["return_path"]=>
24  string(27) "John Doe <john@example.com>"
25  ["from"]=>
26  string(27) "John Doe <john@example.com>"
27  ["reply_to"]=>
28  string(27) "John Doe <john@example.com>"
29  ["to"]=>
30  string(27) "John Doe <john@example.com>"
31  ["cc"]=>
32  string(27) "John Doe <john@example.com>"
33  ["bcc"]=>
34  string(27) "John Doe <john@example.com>"
35}
36array(6) {
37  ["return_path"]=>
38  string(27) "John Doe <john@example.com>"
39  ["from"]=>
40  string(27) "John Doe <john@example.com>"
41  ["reply_to"]=>
42  string(27) "John Doe <john@example.com>"
43  ["to"]=>
44  string(27) "John Doe <john@example.com>"
45  ["cc"]=>
46  string(27) "John Doe <john@example.com>"
47  ["bcc"]=>
48  string(27) "John Doe <john@example.com>"
49}
50