Doc #60795 [Opn->Csd]: strpos() paragraph is misleading

From: Date: Sat, 21 Jan 2012 22:16:46 +0000
Subject: Doc #60795 [Opn->Csd]: strpos() paragraph is misleading
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7807@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60795&edit=1 ID: 60795 Updated by: frozenfire@php.net Reported by: ben at bravenet dot com Summary: strpos() paragraph is misleading -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: frozenfire Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2012-01-21 22:16:22] frozenfire@php.net Automatic comment from SVN on behalf of frozenfire Revision: http://svn.php.net/viewvc/?view=revision&revision=322548 Log: Generalized &return.falseproblem; to reduce confusion, by removing the examples of which values evaluate to false. Closes bug #60795. ------------------------------------------------------------------------ [2012-01-18 23:40:12] anon at anon dot anon "This function may return Boolean FALSE, but may also return 0, which evaluates to FALSE when compared with the == operator. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function." ------------------------------------------------------------------------ [2012-01-18 22:50:51] jam at zoidtechnologies dot com All that needs to be done is to remove the "...such as 0 or """ from the end of the "warning", and it will be much less misleading. ------------------------------------------------------------------------ [2012-01-18 22:44:16] danielc at analysisandsolutions dot com Perhaps something like: "This function can return FALSE or 0. Both evaluate to the same thing when using ==." ------------------------------------------------------------------------ [2012-01-18 22:28:18] ben at bravenet dot com Description: ------------ --- From manual page: http://www.php.net/function.strpos#refsect1-function.strpos-returnvalues --- In the docs it says: -- 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. -- This should be rewritten to something less ambiguous because an empty string can never be returned by this function. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60795&edit=1

« previous php.doc.bugs (#7807) next »