1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

grapheme_substr() no longer returns false in some cases

Cf. <https://github.com/php/doc-en/issues/1653>.
This commit is contained in:
Christoph M. Becker
2022-06-25 13:53:25 +02:00
parent 2245ff665a
commit d21607e3ec

View File

@@ -53,7 +53,7 @@
length of string). If <parameter>length</parameter> is given and is negative, then
that many grapheme units will be omitted from the end of string (after the
start position has been calculated when <parameter>offset</parameter> is negative). If <parameter>offset</parameter>
denotes a position beyond this truncation, &false; will be returned.
denotes a position beyond this truncation, an empty string will be returned.
</para>
</listitem>
</varlistentry>
@@ -69,6 +69,29 @@
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
The function now consistently clamps out-of-bounds offsets to the string boundary.
Previously, &false; was returned instead of the empty string in some cases.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>