>>>> echo (preg_match($pattern, $test) != false)
>>
>> The " != false " here is redundant.
> 
> Understood. But what you think is redundancy is, to me, clarity in
> programming. I happen to think that boolean tests shouldn't ride on
> whether or not an array returned from a function is empty or not (or a
> freaking boolean). If what I'm looking for is a "false" then that's what
> I'll test for.

Fair enough, but in that case I think you want "!== false". The expression you
have -- "($x != false)" -- will be true whether $x is 0, NULL, an empty string,
an empty array, or actually FALSE.

But "$x !== false" will only be true in the last case.

Ben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to