[php-src] Issue #11782: Libxml yields an error but `libxml_get_errors()` returns an empty array

From: Date: Tue, 25 Jul 2023 05:14:38 +0000
Subject: [php-src] Issue #11782: Libxml yields an error but `libxml_get_errors()` returns an empty array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245022@lists.php.net to get a copy of this message
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_


Thread (1 message)

  • fluffycondor
« previous php.bugs (#245022) next »