php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
Description:
------------
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('http://somesite.com/filename.xml');

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

?>

Expected result:
----------------
not found

Actual result:
--------------
ok

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-23 06:39 UTC] rrichards@php.net
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: Sat Dec 21 12:01:31 2024 UTC