In some conditions, may I use an @ character instead of using the longer isset() function?
If not, why not?
I like to use this because in a lot cases I can save several quotation marks, brackets and dots.
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.
I assume you’re talking about the error suppression operator when you say
@character, but that isn’t a replacement forisset().isset()is used to determine whether or not a given variable already exists within a program, to determine if it’s safe to use that variable.What I suspect you’re doing is trying to use the variable regardless of its existance, but supressing any errors that may come from that. Using the
@operator at the beginning of a line tells PHP to ignore any errors and not to report it.The
@operator is shorthand for “temporarily seterror_reporting(0)for this expression”.isset()is a completely different construct.