Re: cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml
| From: | Friedhelm Betz | Date: | Fri, 17 Feb 2006 12:55:57 +0000 |
| Subject: | Re: cvs: phpdoc /en/reference/strings/functions stripos.xml strpos.xml strrpos.xml | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969371969@lists.php.net to get a copy of this message | ||
Nuno Lopes wrote:
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. Friedhelmvrana Fri Feb 17 12:33:11 2006 UTC Modified files: /phpdoc/en/reference/strings/functions stripos.xml strpos.xmlYeah 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..)strrpos.xmlLog: False doesn't cause mixed (howto/working)