首页 > 解决方案 > 更好地检查 PHP 中的肯定或否定条件(或者它是否重要)

问题描述

比较这两段代码:

if (isset(x)){
  // do the is-set thing
}else{
  // do the not-set thing
}
if(!isset(x)){
  // do the not-set thing
}else{
  // do the set thing
}

除了可读性(我发现第一个更简单)之外,两者之间有什么显着区别吗?

标签: php

解决方案


推荐阅读