Doc #75331 [Opn->Csd]: [pt_BR] Old substr behavior when start after negative length
| From: | ae@php.net | Date: | Sat, 28 Oct 2017 14:54:21 +0000 |
| Subject: | Doc #75331 [Opn->Csd]: [pt_BR] Old substr behavior when start after negative length | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15190@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75331&edit=1
ID: 75331
Updated by: ae@php.net
Reported by: jandelson_oliveira at yahoo dot com dot br
Summary: [pt_BR] Old substr behavior when start after
negative length
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Translation problem
Operating System: LINUX e WINDOWS
PHP Version: 7.0.24
-Assigned To:
+Assigned To: ae
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.
Thanks by the patch.
Previous Comments:
------------------------------------------------------------------------
[2017-10-08 13:03:24] requinix@php.net
@thiago: I see your changes and it looks like you followed the right process: make changes, create a
patch, and submit the patch for review. Someone will look over it.
------------------------------------------------------------------------
[2017-10-08 11:57:17] thiago dot oak at gmail dot com
I posted an updated on the Php Docbook Online Editor.
But the process of getting an update out is really confusing
------------------------------------------------------------------------
[2017-10-07 07:44:17] requinix@php.net
> Those docs still say $rest1 should be false
Backwards: they say empty string, should be false.
------------------------------------------------------------------------
[2017-10-07 07:43:13] requinix@php.net
...
Also missing a few comments: when length is given and 0/false/null, when length is omitted, returns
false on failure or empty string, and the Changelog.
------------------------------------------------------------------------
[2017-10-07 07:39:36] requinix@php.net
Works correctly according to the EN docs. https://3v4l.org/rgStf
$rest is false because "length is given and is negative" and "start denotes the
position of this truncation or beyond".
$rest1 is an empty string (not null) because "string is equal to start characters long"
(6) and "length is given and is positive".
http://php.net/manual/en/function.substr.php
But I do see some errors in the pt_BR docs, so I'm repurposing this bug for them.
Those docs still say $rest1 should be false:
- EN: If start denotes the position of this truncation or beyond, FALSE will be returned.
- pt_BR: Se start denota uma posição além da truncagem, uma string vazia será retornada.
And the example needs adjustment:
- EN: $rest = substr("abcdef", 4, -4); // returns false
- pt_BR: $rest = substr("abcdef", 4, -4); // retorna ""
Also:
-
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=75331
--
Edit this bug report at https://bugs.php.net/bug.php?id=75331&edit=1