xref: /PHP-8.2/ext/soap/tests/SoapFault/gh14586.phpt (revision 11fbe880)
1--TEST--
2GH-14586: SoapFault::__construct() leaks memory if called twice
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7$sf = new SoapFault(null, "x");
8$sf->__construct(null, "x");
9try {
10    $sf->__construct("", "");
11} catch (ValueError) {}
12$sf->__construct(null, "x", headerFault: []);
13var_dump($sf->headerfault);
14$sf->__construct(null, "x");
15var_dump($sf->headerfault);
16?>
17DONE
18--EXPECT--
19array(0) {
20}
21NULL
22DONE
23