Re: var_dump( (0 == 'heading') ) == TRUE ?!

From: Date: Sat, 15 May 2010 05:18:55 +0000
Subject: Re: var_dump( (0 == 'heading') ) == TRUE ?!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-305237@lists.php.net to get a copy of this message
== operator type casts the string to integer before comparing so the comparison boils down to 0 == 0 which is true these rules also apply to the switch statement http://php.net/manual/en/language.operators.comparison.php but with === the typecasting does no occur

« previous php.general (#305237) next »