reference/intl/grapheme/grapheme-substr.xml
d21607e3ecb3bd8bb67e098ab906287229d44572
...
...
@@ -9,10 +9,10 @@
9
9
&reftitle.description;
10
10
<para>&style.procedural;</para>
11
11
<methodsynopsis>
12
-
<type>int</type><methodname>grapheme_substr</methodname>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>grapheme_substr</methodname>
13
13
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
-
<methodparam><type>int</type><parameter>start</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
14
+
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>length</parameter><initializer>&null;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
Return part of a string
...
...
@@ -32,13 +32,13 @@
32
32
</listitem>
33
33
</varlistentry>
34
34
<varlistentry>
35
-
<term><parameter>start</parameter></term>
35
+
<term><parameter>offset</parameter></term>
36
36
<listitem>
37
37
<para>
38
38
Start position in default grapheme units.
39
-
If $start is non-negative, the returned string will start at the
40
-
$start'th position in $string, counting from zero. If $start is negative,
41
-
the returned string will start at the $start'th grapheme unit from the
39
+
If <parameter>offset</parameter> is non-negative, the returned string will start at the
40
+
<parameter>offset</parameter>'th position in <parameter>string</parameter>, counting from zero. If <parameter>offset</parameter> is negative,
41
+
the returned string will start at the <parameter>offset</parameter>'th grapheme unit from the
42
42
end of string.
43
43
</para>
44
44
</listitem>
...
...
@@ -48,12 +48,12 @@
48
48
<listitem>
49
49
<para>
50
50
Length in grapheme units.
51
-
If $length is given and is positive, the string returned will contain
52
-
at most $length grapheme units beginning from $start (depending on the
53
-
length of string). If $length is given and is negative, then
51
+
If <parameter>length</parameter> is given and is positive, the string returned will contain
52
+
at most <parameter>length</parameter> grapheme units beginning from <parameter>offset</parameter> (depending on the
53
+
length of string). If <parameter>length</parameter> is given and is negative, then
54
54
that many grapheme units will be omitted from the end of string (after the
55
-
start position has been calculated when a start is negative). If $start
56
-
denotes a position beyond this truncation, &false; will be returned.
55
+
start position has been calculated when <parameter>offset</parameter> is negative). If <parameter>offset</parameter>
56
+
denotes a position beyond this truncation, an empty string will be returned.
57
57
</para>
58
58
</listitem>
59
59
</varlistentry>
...
...
@@ -65,38 +65,33 @@
65
65
<refsect1 role="returnvalues">
66
66
&reftitle.returnvalues;
67
67
<para>
68
-
Returns the extracted part of $string.
68
+
Returns the extracted part of <parameter>string</parameter>, &return.falseforfailure;.
69
69
</para>
70
70
</refsect1>
71
71

72
72
<refsect1 role="changelog">
73
73
&reftitle.changelog;
74
-
<para>
75
-
<informaltable>
76
-
<tgroup cols="2">
77
-
<thead>
78
-
<row>
79
-
<entry>&Version;</entry>
80
-
<entry>&Description;</entry>
81
-
</row>
82
-
</thead>
83
-
<tbody>
84
-
<row>
85
-
<entry>5.4</entry>
86
-
<entry>
87
-
If <parameter>length</parameter> is given and positive and the
88
-
argument string is shorter than the specified length, all the rest of
89
-
the string according to <parameter>start</parameter> parameter is
90
-
returned. Previously, &false; was returned.
91
-
</entry>
92
-
</row>
93
-
</tbody>
94
-
</tgroup>
95
-
</informaltable>
96
-
</para>
74
+
<informaltable>
75
+
<tgroup cols="2">
76
+
<thead>
77
+
<row>
78
+
<entry>&Version;</entry>
79
+
<entry>&Description;</entry>
80
+
</row>
81
+
</thead>
82
+
<tbody>
83
+
<row>
84
+
<entry>8.0.0</entry>
85
+
<entry>
86
+
The function now consistently clamps out-of-bounds offsets to the string boundary.
87
+
Previously, &false; was returned instead of the empty string in some cases.
88
+
</entry>
89
+
</row>
90
+
</tbody>
91
+
</tgroup>
92
+
</informaltable>
97
93
</refsect1>
98
94

99
-

100
95
<refsect1 role="examples">
101
96
&reftitle.examples;
102
97
<example>
...
...
@@ -135,7 +130,6 @@ a%CC%8Abco%CC%88
135
130
</para>
136
131
</refsect1>
137
132
</refentry>
138
-

139
133
<!-- Keep this comment at the end of the file
140
134
Local variables:
141
135
mode: sgml
142
136