Doc #60949 [Com]: The documentation about the return value is not clear!

From: Date: Wed, 01 Feb 2012 16:39:09 +0000
Subject: Doc #60949 [Com]: The documentation about the return value is not clear!
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7895@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 Comment by: anon at anon dot anon Reported by: waldemar dot renke at kirchner-solar-group dot de Summary: The documentation about the return value is not clear! Status: Open Type: Documentation Problem Package: *General Issues PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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.) Previous Comments: ------------------------------------------------------------------------ [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 (#7895) next »