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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 08:01:28 2024 UTC