php - 更好地检查 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
}
除了可读性(我发现第一个更简单)之外,两者之间有什么显着区别吗?
解决方案
推荐阅读
- android - Volley 1.1 对 org.apache.http 的依赖
- python-2.7 - PyUSB如何指定端点的类型和缓冲区大小
- python - 逻辑回归均方误差
- c++ - 在 Azure 或其他云提供商上返回 JSON 字符串的 C++ 应用程序
- python - 需要建议以保持 GUI 响应
- html - 使用 Flexbox 的绝对位置垂直导航
- python - Python Sublime 和 XDebug
- opengl - 如何通过固定功能管道使用assimp?
- c# - 从 C# 中的 JSON 对象获取对象值
- mysql - 为什么 FLOAT 列上的 MYSQL SUM() 会生成分数