Page 1 of 1

if === syntax

Posted: Thu Sep 10, 2009 8:20 am
by Prints
Hi, I'm trying to trace a bug in osCommerce 3, but it uses "===" in many of it's if statements. What is the behaviour of "==="? I see it first time and php manual doesn't mention it.

Is it's functionality same as "=="?

Re: if === syntax

Posted: Thu Sep 10, 2009 8:31 am
by Mark Baker
It's the same as == but with a little bit more, it actually compares the datatype as well as the datavalue

if (0 == 0.0) //compares an integer to a float, will return true
if (0 === 0.0) //compares an integer to a float, will return false

And the PHP manual mentions it plenty if you look