Doc #60949 [Opn->Csd]: The documentation about the return value is not clear!

From: Date: Sat, 04 Feb 2012 20:41:17 +0000
Subject: Doc #60949 [Opn->Csd]: The documentation about the return value is not clear!
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7909@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60949&edit=1 ID: 60949 Updated by: frozenfire@php.net Reported by: waldemar dot renke at kirchner-solar-group dot de Summary: The documentation about the return value is not clear! -Status: Open +Status: Closed Type: Documentation Problem Package: *General Issues PHP Version: Irrelevant -Assigned To: +Assigned To: frozenfire Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-02-04 20:41:07] frozenfire@php.net Automatic comment from SVN on behalf of frozenfire Revision: http://svn.php.net/viewvc/?view=revision&revision=323058 Log: Clarified empty string return value. Closes bug #60949. ------------------------------------------------------------------------ [2012-02-04 17:20:55] php-dev at zerocue dot com At least it is well document. Waldemar: It depends on your inputs, see the information on start and length parameters and it explains what it does in what cases. ------------------------------------------------------------------------ [2012-02-01 16:39:09] anon at anon dot anon What it means is that unlike most languages, PHP's substr stupidly returns boolean false instead of "" for cases like substr("abcde", 5). (And just to be extra unhelpful, it returns null if it doesn't like its parameters.) ------------------------------------------------------------------------ [2012-02-01 14:54:06] waldemar dot renke at kirchner-solar-group dot de Description: ------------ --- From manual page: http://www.php.net/function.substr#refsect1-function.substr-returnvalues --- "Returns the extracted part of string, or FALSE on failure or an empty string." Question: Does it return and empty string on failure, or when it doesn't find a string??? ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60949&edit=1

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