|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-23 06:39 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
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