wordwrap() Add errors/changelog sections, specify U+0020 instead U+20 (#3817)

---------

Co-authored-by: Gina Peter Banyard <girgias@php.net>
This commit is contained in:
Mikhail Alferov
2024-10-03 15:06:32 +03:00
committed by GitHub
parent ebc071c191
commit a6ee935b0e

View File

@@ -18,7 +18,7 @@
<para>
Wraps a string to a given number of characters using a string break
character.
Strings wrap after a space (U+20) character unless <parameter>cut_long_words</parameter>
Strings wrap after a space (U+0020) character unless <parameter>cut_long_words</parameter>
is set to &true;.
</para>
</refsect1>
@@ -47,8 +47,8 @@
<term><parameter>break</parameter></term>
<listitem>
<para>
The line is broken using the optional
<parameter>break</parameter> parameter.
The line is broken using the optional <parameter>break</parameter> parameter.
It must not be an empty string.
</para>
</listitem>
</varlistentry>
@@ -75,6 +75,38 @@
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<simpara>
If <parameter>break</parameter> is an empty string,
a <classname>ValueError</classname> is thrown.
</simpara>
</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>
If <parameter>break</parameter> is empty string,
a <classname>ValueError</classname> is thrown;
previously in this case it emitted an <constant>E_WARNING</constant> and returned &false;.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>