Just a weird PHP question about best practice. Assuming the following function:
function get_option($val) {
return false;
}
I want to assign to a $locale
variable, the value returned from this function and, if false, set to a default en_GB
one.
I discovered 2 option for achieving this goal:
1st Option:
$locale = ( $locale = get_option( 'language_code' ) ) ? $locale : 'en_GB';
2nd Option:
$locale = get_option( 'language_code' ) ? get_option( 'language_code' ) : 'en_GB';
I would like to know which one is more correct and why.
Thanks