Jun 3, 2006 #1 xpblueScreenOfDeath Programmer Joined Sep 1, 2004 Messages 87 I don't quite understand when I need === instead of ==. Can someone clearify this for me?
Jun 3, 2006 1 #2 jpadie Technical User Joined Nov 24, 2003 Messages 10,094 Location FR === means that both sides must be equivalent and of the same time. == means that both sides must be equivalent so that "0" == 0 will be true but "0" === 0 will be false note also that "a" == 0 will be true as the "a" will be converted into a number as it is being compared against a number. the manual is very helpful on this: http://fr2.php.net/manual/en/language.operators.comparison.php Upvote 0 Downvote
=== means that both sides must be equivalent and of the same time. == means that both sides must be equivalent so that "0" == 0 will be true but "0" === 0 will be false note also that "a" == 0 will be true as the "a" will be converted into a number as it is being compared against a number. the manual is very helpful on this: http://fr2.php.net/manual/en/language.operators.comparison.php
Jun 4, 2006 #3 sleipnir214 Programmer Joined May 6, 2002 Messages 15,350 Location US In jpadie's last post the phrase: [tt]and of the same time.[/tt] probably should have read: [tt]and of the same type.[/tt] Want the best answers? Ask the best questions! TANSTAAFL! Upvote 0 Downvote
In jpadie's last post the phrase: [tt]and of the same time.[/tt] probably should have read: [tt]and of the same type.[/tt] Want the best answers? Ask the best questions! TANSTAAFL!