@Cap'n Steve said:
I was just about to make a PHP thread. Here's my contribution, from the [url=http://us2.php.net/manual/en/function.strpos.php]page for strpos()[/url].
This function is supposed to return the position of the first occurrence of a string within a string, but come with this warning:This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.
So basically you can be pretty sure it won't return an object or an array, but anything else is fair game.
This is perfectly sensible. The function returns FALSE to mean "doesn't occur", and 0 to mean "occurs at position 0". What's the big deal here? Just be careful with types: FALSE and 0 both evaluate as "false" in an IF, or with ==, but === compares them properly.