I’ve seen function calls preceded with an at symbol to switch off warnings. Today I was skimming some code and found this:
$hn = @$_POST['hn'];
What good will it do here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
@is the error suppression operator in PHP.See:
Update:
In your example, it is used before the variable name to avoid the
E_NOTICEerror there. If in the$_POSTarray, thehnkey is not set; it will throw anE_NOTICEmessage, but@is used there to avoid thatE_NOTICE.Note that you can also put this line on top of your script to avoid an
E_NOTICEerror: