Nuno Lopes wrote:
vrana Fri Feb 17 12:33:11 2006 UTC
Modified files:
/phpdoc/en/reference/strings/functions stripos.xml strpos.xml
strrpos.xml
Log:
False doesn't cause mixed (howto/working)
Yeah I know! I've already read/change it several times.
Quoting howto:
"Do not use mixed, if the return value is of a certain (not boolean)
type, and FALSE only on error. Provide the primary return type as the
return type of the function, and write down in the explanation, that it
returns FALSE on error. Use &return.success; if the function returns
TRUE on success, and FALSE on failure."
These functions return FALSE on normal operation, not on error.
mysql_connect() for example returns a resource on success or false on
failure. there you shoudn't use mixed.
In this case, the return of false means not found, not a error, ence the
use of mixed. (those pages even have the entity to explain how to use
the === operator..)
Hm, that's arguable. I might argue, that the main purpose is to find the
position in a given string: normal operation. If not found, this might
be an error or failure.
Friedhelm