|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80063 XMLReader not suppressing warnings
Submitted: 2020-09-05 10:50 UTC Modified: -
From: pmishev at gmail dot com Assigned:
Status: Open Package: XML Reader
PHP Version: 7.3.22 OS: Ubuntu 18.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: pmishev at gmail dot com
New email:
PHP Version: OS:


 [2020-09-05 10:50 UTC] pmishev at gmail dot com
Warnings when opening an non-existing XML file are not being suppressed.

Neither libxml_use_internal_errors(true), nor setting LIBXML_NOERROR | LIBXML_NOWARNING has any effect whatsoever.

The problem seems related to

Test script:

$xml = 'compress.zlib://inexisting_file.xml.gz';


$reader = new XMLReader();
$reader->open($xml, null, LIBXML_NOERROR | LIBXML_NOWARNING);



Expected result:
No PHP warnings thrown, and an error showing up in print_r

Actual result:
PHP Warning:  XMLReader::open(compress.zlib://inexisting_file.xml.gz): failed to open stream: operation failed in test.php on line 8
PHP Warning:  XMLReader::open(): Unable to open source data in test.php on line 8
PHP Warning:  XMLReader::read(): Load Data before trying to read in test.php on line 10


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Mar 09 08:01:24 2021 UTC