Skip to content

Commit 2583cd8

Browse files
ext/intl: Add negative $offset for grapheme_strr functions (#4864)
* Add negative $offset for grapheme_strr functions Co-authored-by: Jordi Kroon <jordikroon@php.net>
1 parent a38e360 commit 2583cd8

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

reference/intl/grapheme/grapheme-strripos.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
The position returned is still relative to the beginning of <parameter>haystack</parameter>
5050
regardless of the value of <parameter>offset</parameter>.
5151
</para>
52+
<simpara>
53+
The optional offset parameter allows you to specify where in <parameter>haystack</parameter> to start searching as an <parameter>offset</parameter> in grapheme units (not bytes or characters). If the <parameter>offset</parameter> is negative, it is treated relative to the end of the string. The position returned is still relative to the beginning of <parameter>haystack</parameter> regardless of the value of offset. The search is performed right to left, searching for the first occurrence of <parameter>needle</parameter> from the selected grapheme cluster.
54+
</simpara>
5255
</listitem>
5356
</varlistentry>
5457
<varlistentry>

reference/intl/grapheme/grapheme-strrpos.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
The position returned is still relative to the beginning of <parameter>haystack</parameter>
5050
regardless of the value of <parameter>offset</parameter>.
5151
</para>
52+
<simpara>
53+
The optional offset parameter allows you to specify where in <parameter>haystack</parameter> to start searching as an <parameter>offset</parameter> in grapheme units (not bytes or characters). If the <parameter>offset</parameter> is negative, it is treated relative to the end of the string. The position returned is still relative to the beginning of <parameter>haystack</parameter> regardless of the value of offset. The search is performed right to left, searching for the first occurrence of <parameter>needle</parameter> from the selected grapheme cluster.
54+
</simpara>
5255
</listitem>
5356
</varlistentry>
5457
<varlistentry>

0 commit comments

Comments
 (0)