0

sometime I see pepole use @ with variables
ex:
@$cat=$_GET;

is this something like pass by reference?

can you direct me to a good tutorial in this matter

Thank you

5
Contributors
6
Replies
8
Views
9 Years
Discussion Span
Last Post by kusal
0

@ doesn't help it error handling, but it supresses the errors.

if(@mysql_num_rows($result) > 0){ //do something

This above code, supresses the warning if there is something wrong with the query. Its not a good practice to have @, because it makes your life very difficult to know where the exact error is.

0

. Its not a good practice to have @, because it makes your life very difficult to know where the exact error is.

I agree. I have absolutely never used it.... another lazy practice even worse than short tags.

Good code has error handling, not error suppression.


Matti Ressler
Suomedia

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.