'At' symbol before variable name in PHP: @$_POST

前端 未结 4 2036
梦谈多话
梦谈多话 2020-12-03 00:34

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\'];

4条回答
  •  一向
    一向 (楼主)
    2020-12-03 00:59

    It suppresses warnings if $_POST['something'] is not defined.

提交回复
热议问题