Wednesday, May 05, 2010

 

Equality is Supposed to be Transitive

Equality is one of those operators that you expect to be transitive. In general, we expect that
if
a=b
and
b=c
then
a=c
Sadly that's not always the case in PHP.
(1 == true) => true
(true == "true") => true
(1 == "true") => false

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?