Doc #60949 [Com]: The documentation about the return value is not clear!
| From: | php-dev at zerocue dot com | Date: | Sat, 04 Feb 2012 17:20:55 +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-7907@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: php-dev at zerocue dot com
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:
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.
Previous Comments:
------------------------------------------------------------------------
[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