无法理解原始类型===
的要点:!==
$a === $b TRUE if $a is equal to $b, and they are of the same type.
$a !== $b TRUE if $a is not equal to $b, or they are not of the same type.
假设$request->getMethod()
返回GET
or POST
(as string
) 并且$form->isValid()
返回一个布尔值true
or false
,下面的代码:
if('POST' === $request->getMethod() || (false === $form->isValid())) :
endif;
对这个较短的有任何意义:
if('POST' == $request->getMethod() || !$form->isValid()) :
endif;