Ahhh! So write a wrapper function! using @ is terrible, terrible terrible!
I use the below code, because it's more readable - probably slower, but it's
better than error supression
http://ircphp.com/users/imho/?file=Vars.php
Depends on your viewpoint, I came across an application that did that before. - it tends to distance code that deals with input from the input variables, making code reviews alot more complex. - eg. if the code explicity says $_GET.... you know that the variable, is
a) unclean.
b) untrusted..
as soon as you wrap $_GET, you very quickly start getting into unknowns (is it escaped?, was it set?, where did it come from?) - code paths that lead to potential holes..
using @ is not terible, it just has to be used with care.. - same goes for all lanugage features.. - It's there for a reason. The same arguments for not using @ apply to GOTO, and you can grep the php source and find goto alot.. :)
Regards
Alan
** if the variable is normally not set:
if (isset($somevar) && $somevar == ....
is probably going to be faster
(this is based on the priniciple that someone is likely to have
implemented a error_handler...)
Regards
Alan
-- Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com
--
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com