infoMore than 5 years have passed since last update.
PHP isset, empty, is_null の違い早見表
Last updated at Posted at 2016-06-22
PHP isset, empty, is_null の違い早見表
値 |
if($var) |
isset |
empty |
is_null |
$var=1 |
true |
true |
false |
false |
$var=""; |
false |
true |
true |
false |
$var="0"; |
false |
true |
true |
false |
$var=0; |
false |
true |
true |
false |
$var=NULL; |
false |
false |
true |
true |
$var |
false |
false |
true |
true |
$var=array() |
false |
true |
true |
false |
$var=array(1) |
true |
true |
false |
false |
引用
参考リンク
1063Go to list of users who liked
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up