Seems to me PHP is trying to be too clever for it's own good. Especially in evaluating (string) 0 as false.
Means to check whether a variable contains a zero length string, you have to do if(strlen($string)) or if(empty($string)) instead of just if($string).
And if your going to evaluate (string)(int) 0 to false, why not (string)(float) 0.00.
It's just one more annoying thing you have to remember.
More information about formatting options
Seems to me PHP is trying to
Seems to me PHP is trying to be too clever for it's own good. Especially in evaluating (string) 0 as false.
Means to check whether a variable contains a zero length string, you have to do if(strlen($string)) or if(empty($string)) instead of just if($string).
And if your going to evaluate (string)(int) 0 to false, why not (string)(float) 0.00.
It's just one more annoying thing you have to remember.