[wp-trac] Re: [WordPress Trac] #4928: $locale var may be set but false

WordPress Trac wp-trac at lists.automattic.com
Fri Sep 7 13:51:56 GMT 2007


#4928: $locale var may be set but false
--------------------+-------------------------------------------------------
 Reporter:  ashnur  |        Owner:  anonymous 
     Type:  defect  |       Status:  new       
 Priority:  normal  |    Milestone:  2.4 (next)
Component:  i18n    |      Version:  2.3       
 Severity:  minor   |   Resolution:            
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by Viper007Bond):

 Replying to [comment:2 ashnur]:
 > Replying to [comment:1 Viper007Bond]:
 >
 > it's not doubletesting, it's testing if it's false.
 >
 > i, myself like this much cleaner method where first i check if a
 variable is set, then i check it if it's false.

 Yes, but again, why test twice when you can just test once?

 {{{
 if ( !empty($locale) ) { ...
 }}}

 Would that not get the job done?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4928#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list