LoginSignup
0
1

More than 3 years have passed since last update.

PHP boolに変換するときにfalseとみなされる値

Posted at

目的

  • boolに変換するときにfalseとみなされる値をまとめる

補足

  • 紹介する値はboolに変換するときにfalseとみなされる。したがってif文などの条件式に紹介する値が入るとfalseとして扱われる。

bool変換後にfalseとみなされる値

  1. integer型の0(ゼロ)
  2. float型の0.0
  3. float型の-0.0
  4. 空の文字列
  5. 文字列の0(ゼロ)
  6. 要素の数がゼロの配列
  7. NULL
  8. 値がセットされていない変数

参考文献

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1