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