On Wed, Jul 29, 2009 at 23:33, Alban<s...@paradoxal.org> wrote:
> Le Fri, 24 Jul 2009 15:23:21 +0200, user a écrit :
>
>> I published a (work in progress) RFC today about replacing certain
>> errors with exceptions. I know that there already was something similiar
>> on the php6dev blog, but this is not completly the same, so awating your
>> comments:
>>
>> http://wiki.php.net/rfc/errors_as_exceptions
>
> I'm agree for replacing error by exception. Even if this not a good idea,
> i think there is a big problem with error gesture into php.
>
> Exemple : http://fr3.php.net/manual/en/function.simplexml-load-string.php
[...]
> The result is it's impossible to use this function without @ statement.

Are you intentionally ignoring what I've said previously in the thread?
Please stop using SimpleXML as an example. You do not need @.
<?php
libxml_use_internal_errors(true);
$sxe = simplexml_load_string("<?xml version='1.0'><broken><xml></broken>");
if (!$sxe) {
  echo "Failed loading XML\n";
  foreach(libxml_get_errors() as $error) {
    echo "\t", $error->message;
  }
}

Outputs:
Failed loading XML
        Blank needed here
        parsing XML declaration: '?>' expected
        Opening and ending tag mismatch: xml line 1 and broken
        Premature end of data in tag broken line 1

No PHP warnings at all.


Again. The examples you are looking for are network issues with
fopen(), file_get_contents() and such things.

-Hannes

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to