Re: Control Structure problem

From: Date: Wed, 17 Sep 2003 02:53:17 +0000
Subject: Re: Control Structure problem
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-162821@lists.php.net to get a copy of this message
* Thus wrote Eugene Lee (list-php@fsck.net): > On Wed, Sep 17, 2003 at 12:49:03AM +0000, Curt Zirzow wrote: > The switch statement doesn't do an equivalency test, does it? So while > this switch statement can be rewritten as: > > if (($var == 'TEST-1') || ($var == 'TEST-1') || ($var == > 'TEST-1')) > { > do something > } > > it doesn't do: > > if (($var === 'TEST-1') || ($var === 'TEST-1') || ($var === > 'TEST-1')) > { > do something > } Correct. Although in most cases == is a good enough test. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#162821) next »