News for hackers. Stuff that matters.
Re:PHP WTF: A PHP Annoyance Posted Every Day by Deestan on Friday June 19, 2009 @10:08AM (#665132)
So:

  0 == 'x'
results in

  bool(true)
Does anyone know the technical reasons for this?
Re:PHP WTF: A PHP Annoyance Posted Every Day by rbanffy on Friday June 19, 2009 @10:19AM (#665153)
daeken explained it quite well. From his post:

"As explained under 'read more', it's because 'test' will be cast to a number for comparison. Since 'test' isn't a number, it becomes 0, which is equivalent."

Re:PHP WTF: A PHP Annoyance Posted Every Day by mlLK on Friday June 19, 2009 @12:55PM (#665473)
These tables illustrate how complicated type checking in PHP really is: http://www.php.net/manual/en/types.comparisons.php