布尔OR条件 - 出了什么问题?

Arn*_*hor 1 php boolean

这是条件 -

if ($file !== "." || $file !== "..")
Run Code Online (Sandbox Code Playgroud)

不工作

if (($file !== ".") || ($file !== ".."))
Run Code Online (Sandbox Code Playgroud)

也没有工作.

if ($file !== ".")
Run Code Online (Sandbox Code Playgroud)

工作得很好."这真的让我感到前卫.我已经阅读了php.net在逻辑运算符上提供的所有内容(http://php.net/manual/en/language.operators.logical.php),我搜索了一堆糟糕的教程,而且我三重 -检查运算符优先级.从各方面来看,任何一种方法都应该有效.

可能是什么原因?

fir*_*ire 10

$file不应该是.和它不应该..

if ($file !== "." && $file !== "..")