Issue: https://github.com/php/php-src/issues/11782
Author: fluffycondor
### Description
The following code:
https://3v4l.org/8vJBH
```php
<?php
$dom = new DOMDocument();
if (!$dom->loadXML('<malformed></mlfrm>')) {
print_r(libxml_get_errors());
}
```
Resulted in this output:
```
Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: malformed line 1 and mlfrm in
Entity, line: 1 in /in/8vJBH on line 4
Array
(
)
```
But I expected this output instead:
```
Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: malformed line 1 and mlfrm in
Entity, line: 1 in /in/8vJBH on line 4
Array
(
[0] => ... LibXMLError object ...
)
```
### PHP Version
any
### Operating System
_No response_