php.net |  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
Votes:1
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tuepp at web dot de
New email:
PHP Version: OS:

 

 [2016-04-15 13:53 UTC] tuepp at web dot de
Description:
------------
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();
\libxml_use_internal_errors(true);
$reader->open('fail', null, \LIBXML_NOWARNING|\LIBXML_NOERROR);
$reader->setSchema('fail');

Expected result:
----------------
bool(false)
bool(false) 

Actual result:
--------------
Warning: XMLReader::open(): Unable to open source data in C:\xampp\htdocs\bugReport\index.php on line 4
bool(false)
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
bool(false) 

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-18 17:28 UTC] jhdxr@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jhdxr
 [2016-04-18 17:28 UTC] jhdxr@php.net
`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] jhdxr@php.net
-Status: Assigned +Status: Wont fix
 [2016-07-11 11:19 UTC] jhdxr@php.net
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: Thu Mar 28 17:01:29 2024 UTC