|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
38 + 3 = ?
Subscribe to this entry?

 [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-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 15 18:05:44 2022 UTC