xref: /PHP-7.3/ext/imap/tests/bug80220.phpt (revision 7f3bdda2)
1--TEST--
2Bug #80220 (imap_mail_compose() may leak memory) - message/rfc822 regression
3--SKIPIF--
4<?php
5if (!extension_loaded('imap')) die('skip imap extension not available');
6?>
7--FILE--
8<?php
9$bodies = [[
10    'type' => TYPEMESSAGE,
11    'subtype' => 'RFC822',
12], [
13    'contents.data' => 'asd',
14]];
15var_dump(imap_mail_compose([], $bodies));
16
17$bodies = [[
18    'type' => TYPEMESSAGE,
19], [
20    'contents.data' => 'asd',
21]];
22var_dump(imap_mail_compose([], $bodies));
23?>
24--EXPECT--
25string(53) "MIME-Version: 1.0
26Content-Type: MESSAGE/RFC822
27
28
29"
30string(53) "MIME-Version: 1.0
31Content-Type: MESSAGE/RFC822
32
33
34"
35