Proper way to declare multiple vars in PHP

后端 未结 7 1818
清歌不尽
清歌不尽 2021-01-31 01:48

I\'ve been coding personal scripts for years in PHP and get used to turn off Error display. I\'m about to release some of these scripts and would like to do it the proper way.

7条回答
  •  伪装坚强ぢ
    2021-01-31 02:10

    Why not just set them?

    
    

    If you're trying to preserve the value in them, then yes that's the correct way in general. Note that you don't need the second pair of brackets in your statements:

    if (!isset($foo)) $foo = '';
    

    is enough.

提交回复
热议问题