if ('constant' == $variable) vs. if ($variable == 'constant')
- by Tom Auger
Lately, I've been working a lot in PHP and specifically within the WordPress framework. I'm noticing a lot of code in the form of:
if ( 1 == $options['postlink'] )
Where I would have expected to see:
if ( $options['postlink'] == 1 )
Is this a convention found in certain languages / frameworks? Is there any reason the former approach is…