#26916 [Opn->Bgs]: docs for substr("", 0, 0) is not clear
| From: | eru@php.net | Date: | Thu, 15 Jan 2004 11:57:48 +0000 |
| Subject: | #26916 [Opn->Bgs]: docs for substr("", 0, 0) is not clear | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53377@lists.php.net to get a copy of this message | ||
ID: 26916
Updated by: eru@php.net
Reported By: csongibacsi at nexum dot hu
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux video 2.4.18-bf2.4 #1 Son
PHP Version: 4.3.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Ehm the string "abc" has no [3], we start counting at 0.
"If start is non-negative, the returned string will start at the
start'th position in string, counting from zero."
Previous Comments:
------------------------------------------------------------------------
[2004-01-15 06:16:23] csongibacsi at nexum dot hu
Description:
------------
The real behaviour is different from the one which is described in the
docs.
The docs says: "If string is less than start characters long, FALSE
will be returned." In the case of the parameters described below, the
string "abc" is not less than 3 characters long so it should NOT give
back FALSE, but it gives.
Reproduce code:
---------------
var_dump( substr( "abc", 3, 0 ) );
Expected result:
----------------
string(0) ""
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26916&edit=1