Is this an okay practice or an acceptable way to use PHP’s error suppressing?
if (isset($_REQUEST['id']) && $_REQUEST['id'] == 6) {
echo 'hi';
}
if (@$_REQUEST['id'] == 6) {
echo 'hi';
}
EDIT:
I thought so too. The code (and idea) is from friend.
Thanks for proving me right. 🙂
It’s not a really good practice to use error suppressing. It’s even not a good practice to use $_REQUEST at all. Just use isset() or !empty() or whatever, don’t be lazy.
And one more thing, it is a “good practice” to close parenthesis when using isset() 🙂