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