Jump to content

3 =s?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
What does the 3 = signs mean in a statement like this?


if ("0" === 0) echo "true\n";


which, by the way, equals false.

#2
sarahk

sarahk

    Newbie

  • Members
  • PipPip
  • 18 posts
It means absolutely the same.

1 == '1' will be true because PHP can see that they're the same value

by the same method 0 can be the same as false
any number greater than 0 can be true

but if you use === 0 is a number and false is boolean and they're not the same at all.

does that make sense?

#3
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
NeedHelp, its the same as == , but where == cant tell the difference between a integer and a string, === is type sensitive.