|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72032 No error suppression
Submitted: 2016-04-15 13:53 UTC Modified: 2016-07-11 11:19 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tuepp at web dot de Assigned: jhdxr (profile)
Status: Wont fix Package: XML Reader
PHP Version: 7.0.5 OS: Windows 7 Professional
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: tuepp at web dot de
New email:
PHP Version: OS:


 [2016-04-15 13:53 UTC] tuepp at web dot de
I guess bug #64230 is back in PHP7:
It is not possible to disable errors, neither using \libxml_use_internal_errors(true), nor using option
open($URI, $encoding = null, $options = LIBXML_NOWARNING|LIBXML_NOERROR)

Test script:
$reader = new \XMLReader();
$reader->open('fail', null, \LIBXML_NOWARNING|\LIBXML_NOERROR);

Expected result:

Actual result:
Warning: XMLReader::open(): Unable to open source data in C:\xampp\htdocs\bugReport\index.php on line 4
Warning: XMLReader::setSchema(): Unable to set schema. This must be set prior to reading or schema contains errors. in C:\xampp\htdocs\bugReport\index.php on line 5


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-18 17:28 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jhdxr
 [2016-04-18 17:28 UTC]
`libxml_use_internal_errors` only affect the errors generated by the libxml, so do `LIBXML_NOWARNING|LIBXML_NOERROR`, but the warning you mentioned is generated by php.
However, I think when user pass `LIBXML_NOWARNING`, there should be no warning. So I submited a patch to remove the warnings when `LIBXML_NOWARNING` presents.
 [2016-07-11 11:19 UTC]
-Status: Assigned +Status: Wont fix
 [2016-07-11 11:19 UTC]
according to the discuss on github pr, this is marked as won't fix
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 22:01:29 2024 UTC