|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56562 Opening remote XML always return true
Submitted: 2005-09-26 10:22 UTC Modified: 2005-10-23 06:39 UTC
From: uros dot gruber at vizija dot si Assigned: rrichards (profile)
Status: Closed Package: xmlReader (PECL)
PHP Version: Irrelevant OS: FreeBSD
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: uros dot gruber at vizija dot si
New email:
PHP Version: OS:


 [2005-09-26 10:22 UTC] uros dot gruber at vizija dot si
If you try to open remote XML file and the file does not exist it return true instead of false.

Also in any error script create a warning which IMHO is "stupid" thing to do. For example: We use Zend Platform and have enabled warning events. And everytime xml file can't be read because of net failure, we have a new warning. But if file can't be open it must return false and then in some other mechanism to report what kind of an error.

I talk with Christian and disapoint me that Exceptions is not on todo list. Instead of that there is some other "better" error handling. I think Exceptions would be great in such situations. Java do it, .net also. Why should be any difference here.

Reproduce code:
$reader = new XMLReader();
$res = $reader->open('');

if ($res) {
    echo "ok";
} else {
    echo "not found";


Expected result:
not found

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-23 06:39 UTC]
problem was elsewhere and is fixed in the 5.1 branch. Unable to fix behavior for the PECL extension to use with 5.0 though.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 03:01:28 2024 UTC