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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

Pull requests:

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: Mon Nov 11 04:01:27 2024 UTC