|
Posted by Tim Martin on 04/21/06 13:20
milahu wrote:
> Tim Martin wrote:
>> milahu wrote:
>>> IMO, the most odd thing about this is the single "&" between the two
>>> statements; I would use "&&" or "and" here. ;)
>> Why would you do that? '&&' and '&' are completely different operators,
>> and give different results when evaluated in boolean context on two numbers.
>
> Because I prefer comparing boolean values with logical instead of byte
> operators.
>
Sorry, I misread you. I thought you were referring to replacing the
second '&', not the first one. I didn't even spot that the two boolean
expressions were being combined with a bitwise operator (which I agree
is wrong).
For reference, the function in question was:
function is_even($num){
return (is_numeric($num)&(!($num&1)));
}
Tim
Navigation:
[Reply to this message]
|