[drupal-devel] What the difference between '==' and '==='

Carl McDade carl_mcdade at yahoo.com
Wed Mar 30 13:11:46 UTC 2005


Hmm,

After I wrote that last post I realized that booleans may be effected
also. You might check this:


0 == FALSE; //true
0 === FALSE; //false

Carl McDade

Gordon Heydon wrote:
> Hello,
> 
> I was just doing some work, and work some reason the form_select would
> select every thing.
> 
> Here is what I coded.
> 
> form_select('', 'result][' .$payment->txnid, '', array('' => t('select
> result'), '1' => t('cleared'), '0' => t('dishonoured'))
> 
> And for some reason every option was selected.
> 
> I changed line 1329 in common.inc from ($value == $key ? '
> selected="selected"' : '')) to ($value === $key ? '
> selected="selected"' : '')) and it started working.
> 
> Is my form_select call wrong, or is there some difference between == 
> and
> ===
> 
> Thanks.



More information about the drupal-devel mailing list