svn: /phpdoc/en/trunk/reference/mbstring/functions/ mb-strcut.xml mb-substr.xml
| From: | Christoph Michael Becker | Date: | Fri, 31 Jul 2015 17:10:28 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mbstring/functions/ mb-strcut.xml mb-substr.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13492@lists.php.net to get a copy of this message | ||
cmb Fri, 31 Jul 2015 17:10:28 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337268
Log:
fixed documentation wrt. $start and $length parameters (fixes #70177)
Bug: https://bugs.php.net/70177 (Open) Undecumented changes
in mb_substr behavior
Changed paths:
U phpdoc/en/trunk/reference/mbstring/functions/mb-strcut.xml
U phpdoc/en/trunk/reference/mbstring/functions/mb-substr.xml
Modified: phpdoc/en/trunk/reference/mbstring/functions/mb-strcut.xml
===================================================================
--- phpdoc/en/trunk/reference/mbstring/functions/mb-strcut.xml 2015-07-30 22:18:55 UTC (rev 337267)
+++ phpdoc/en/trunk/reference/mbstring/functions/mb-strcut.xml 2015-07-31 17:10:28 UTC (rev 337268)
@@ -41,8 +41,19 @@
<term><parameter>start</parameter></term>
<listitem>
<para>
- Starting position in <emphasis>bytes</emphasis>.
+ If <parameter>start</parameter> is non-negative, the returned string
+ will start at the <parameter>start</parameter>'th
<emphasis>byte</emphasis> position in
+ <parameter>string</parameter>, counting from zero. For instance,
+ in the string '<literal>abcdef</literal>', the byte at
+ position <literal>0</literal> is '<literal>a</literal>',
the
+ byte at position <literal>2</literal> is
+ '<literal>c</literal>', and so forth.
</para>
+ <para>
+ If <parameter>start</parameter> is negative, the returned string
+ will start at the <parameter>start</parameter>'th byte
+ from the end of <parameter>string</parameter>.
+ </para>
</listitem>
</varlistentry>
<varlistentry>
@@ -74,6 +85,32 @@
</para>
</refsect1>
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.4.8</entry>
+ <entry>
+ Passing <literal>NULL</literal> as <parameter>length</parameter>
+ extracts all bytes to the end of the string. Prior to this version
+ <literal>NULL</literal> was treated the same as
<literal>0</literal>.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Modified: phpdoc/en/trunk/reference/mbstring/functions/mb-substr.xml
===================================================================
--- phpdoc/en/trunk/reference/mbstring/functions/mb-substr.xml 2015-07-30 22:18:55 UTC (rev 337267)
+++ phpdoc/en/trunk/reference/mbstring/functions/mb-substr.xml 2015-07-31 17:10:28 UTC (rev 337268)
@@ -41,8 +41,19 @@
<term><parameter>start</parameter></term>
<listitem>
<para>
- Position of first character to use from <parameter>str</parameter>.
+ If <parameter>start</parameter> is non-negative, the returned string
+ will start at the <parameter>start</parameter>'th position in
+ <parameter>string</parameter>, counting from zero. For instance,
+ in the string '<literal>abcdef</literal>', the character at
+ position <literal>0</literal> is '<literal>a</literal>',
the
+ character at position <literal>2</literal> is
+ '<literal>c</literal>', and so forth.
</para>
+ <para>
+ If <parameter>start</parameter> is negative, the returned string
+ will start at the <parameter>start</parameter>'th character
+ from the end of <parameter>string</parameter>.
+ </para>
</listitem>
</varlistentry>
<varlistentry>
@@ -75,6 +86,32 @@
</para>
</refsect1>
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.4.8</entry>
+ <entry>
+ Passing <literal>NULL</literal> as <parameter>length</parameter>
+ extracts all characters to the end of the string. Prior to this version
+ <literal>NULL</literal> was treated the same as
<literal>0</literal>.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>