<i id='4bgxP'><tr id='4bgxP'><dt id='4bgxP'><q id='4bgxP'><span id='4bgxP'><b id='4bgxP'><form id='4bgxP'><ins id='4bgxP'></ins><ul id='4bgxP'></ul><sub id='4bgxP'></sub></form><legend id='4bgxP'></legend><bdo id='4bgxP'><pre id='4bgxP'><center id='4bgxP'></center></pre></bdo></b><th id='4bgxP'></th></span></q></dt></tr></i><div id='4bgxP'><tfoot id='4bgxP'></tfoot><dl id='4bgxP'><fieldset id='4bgxP'></fieldset></dl></div>

    <tfoot id='4bgxP'></tfoot>

      <legend id='4bgxP'><style id='4bgxP'><dir id='4bgxP'><q id='4bgxP'></q></dir></style></legend>
        <bdo id='4bgxP'></bdo><ul id='4bgxP'></ul>

    1. <small id='4bgxP'></small><noframes id='4bgxP'>

        isset($var) 与 @$var

        时间:2023-09-21

            <small id='nJSLI'></small><noframes id='nJSLI'>

            <legend id='nJSLI'><style id='nJSLI'><dir id='nJSLI'><q id='nJSLI'></q></dir></style></legend>

            <i id='nJSLI'><tr id='nJSLI'><dt id='nJSLI'><q id='nJSLI'><span id='nJSLI'><b id='nJSLI'><form id='nJSLI'><ins id='nJSLI'></ins><ul id='nJSLI'></ul><sub id='nJSLI'></sub></form><legend id='nJSLI'></legend><bdo id='nJSLI'><pre id='nJSLI'><center id='nJSLI'></center></pre></bdo></b><th id='nJSLI'></th></span></q></dt></tr></i><div id='nJSLI'><tfoot id='nJSLI'></tfoot><dl id='nJSLI'><fieldset id='nJSLI'></fieldset></dl></div>
          1. <tfoot id='nJSLI'></tfoot>

                <bdo id='nJSLI'></bdo><ul id='nJSLI'></ul>

                  <tbody id='nJSLI'></tbody>
                • 本文介绍了isset($var) 与 @$var的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  这是使用 PHP 错误抑制的好做法还是可接受的方法?

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


                  我也是这么想的.代码(和想法)来自朋友.
                  谢谢你证明我是对的.:)


                  I thought so too. The code (and idea) is from friend.
                  Thanks for proving me right. :)

                  推荐答案

                  使用错误抑制并不是一个很好的做法.使用 $_REQUEST 甚至都不是一个好习惯.只需使用 isset() 或 !empty() 或其他什么,不要偷懒.

                  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.

                  还有一件事,在使用isset()时关闭括号是一个好习惯":)

                  And one more thing, it is a "good practice" to close parenthesis when using isset() :)

                  这篇关于isset($var) 与 @$var的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在mysql数据库连接中使用抛出异常 下一篇:如何告诉 PHP 将异常转储为原始文本而不是 HTML

                  相关文章

                  最新文章

                • <tfoot id='tI9dr'></tfoot>
                • <small id='tI9dr'></small><noframes id='tI9dr'>

                  <legend id='tI9dr'><style id='tI9dr'><dir id='tI9dr'><q id='tI9dr'></q></dir></style></legend>

                    <bdo id='tI9dr'></bdo><ul id='tI9dr'></ul>
                      <i id='tI9dr'><tr id='tI9dr'><dt id='tI9dr'><q id='tI9dr'><span id='tI9dr'><b id='tI9dr'><form id='tI9dr'><ins id='tI9dr'></ins><ul id='tI9dr'></ul><sub id='tI9dr'></sub></form><legend id='tI9dr'></legend><bdo id='tI9dr'><pre id='tI9dr'><center id='tI9dr'></center></pre></bdo></b><th id='tI9dr'></th></span></q></dt></tr></i><div id='tI9dr'><tfoot id='tI9dr'></tfoot><dl id='tI9dr'><fieldset id='tI9dr'></fieldset></dl></div>