Weak typing in PHP: why use isset at all?

前端 未结 9 843
孤街浪徒
孤街浪徒 2020-12-01 12:38

It seems like my code works to check for null if I do

if ($tx) 

or

if (isset($tx))

why would I do the se

9条回答
  •  时光说笑
    2020-12-01 13:31

    Because the first produces a warning, and will also return true if $tx === false, which is not the same as not defined

提交回复
热议问题