On 25.03.2009, at 19:19, Bernhard Schussek wrote:
>
> Hi Romain,
>
> I don't agree that the usage of @ is evil in general. In my opinion
> the @-operator should only be used in conjunction with proper error
> management though, because if I handle an error, I don't want it to
> appear in my logs.
>
> This should in my opinion also be done in symfony.
>
> Example:
>
> if (!$fp = fopen(...))
> {
> $e = error_get_last();
> throw new FileException($e['message'], $e['type']);
> }
>
> This way you can properly discover the error or recover from it.
The @ operator has severe overhead. However there are some internal
functions that just suck in terms of error handling. With many you are
actually sort of forced to use @ and maybe even track errors. But yes
if @ is used its an absolute must that the return value is properly
checked.
regards,
Lukas Kahwe Smith
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---