xref: /PHP-8.3/ext/imap/tests/gh9309.phpt (revision 71c22efa)
1--TEST--
2Bug GH-9309 (Segfault when connection is used after imap_close())
3--EXTENSIONS--
4imap
5--SKIPIF--
6<?php
7require_once(__DIR__.'/setup/skipif.inc');
8?>
9--FILE--
10<?php
11require_once(__DIR__.'/setup/imap_include.inc');
12$stream_id = setup_test_mailbox('gh9309', 0, $mailbox);
13imap_close($stream_id);
14try {
15    imap_headers($stream_id);
16} catch (ValueError $ex) {
17    echo $ex->getMessage(), PHP_EOL;
18}
19?>
20--CLEAN--
21<?php
22$mailbox_suffix = 'gh9309';
23require_once(__DIR__.'/setup/clean.inc');
24?>
25--EXPECT--
26Create a temporary mailbox and add 0 msgs
27New mailbox created
28IMAP\Connection is already closed
29