isset($var) vs. @$var

Posted by Josso on Stack Overflow See other posts from Stack Overflow or by Josso
Published on 2010-04-08T13:43:59Z Indexed on 2010/04/08 13:53 UTC
Read the original article Hit count: 327

Filed under:
|

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';
}

© Stack Overflow or respective owner

Related posts about php

Related posts about error-handling