Hi,
There is a legitimate use I included. The part of sfFileCache:
@unlink($path);
rename($tmpFile, $path);
on Windows rename fails if the file exists. So there is need to delete it
(If you are on *nix, there is no need to unlink because rename overwrites)
But when the file does not exist unlink emits a warning.
So proposals?
Add an extra check if the file exists. Could be done, but results in an
extra file operation that is not required. We want to write a new file.
Always
Other options? Leave the @ away? Log message, but the code solves this.
So I agree that @ suppression is evil, but it is not more evil than the
strange behaviour PHP shows at some places.
All places where I have seen @ in symphony are legitimate usage of the @
operator.
If you find a place where you have a doubt, feel free to ticket it, but keep
in mind that most @ are included to solve platform specific warnings (like
above) s you better test in Mac, Linux and Windows
Fabian
From: [email protected] [mailto:[email protected]]
On Behalf Of Dustin Whittle
Sent: Mittwoch, 25. März 2009 19:31
To: symfony-devs; Romain Dorgueil
Subject: [symfony-devs] Re: About the use of PHP @-statements
Romain,
I completely agree here, there should be absolutely no @ error supression in
symfony core. If you find these cases, please file tickets, and lets get
them fixed.
- Dustin
On 3/25/09 9:39 AM, "Romain Dorgueil" <[email protected]>
wrote:
consider thoose as a very bad practise, that should be avoided as much as
possible. There is many case where using "@" will cause debugging headaches,
and it's often used only because the developper is lazy and don't want to
handle non-fatal errors.
The major problem is when the non-fatal error become an unpredicted fatal
error for whatever reason. PHP then nicely hide it and ruins your day by the
way.
Remember that hiding and avoiding warnings/notices is not at all the same
thing.
I agree there is a very few case in which the use of @-statements is
required, often because of poorly written builtins/extensions of PHP, but
that's really a rare case and their use should be strictly limitted to that,
imho.
Seeing more and more places in symfony where @-statements appears i'm
starting to see red elephpants as warnings... (111 code lines starts by '@'
and 107 contains "something = @...", som
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---