Skip to content

Commit

Permalink
Fix GH-2233: Improve xml_parser_get/set_option parameters section (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois authored Aug 1, 2023
1 parent 28c6feb commit 98b4495
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
26 changes: 22 additions & 4 deletions reference/xml/functions/xml-parser-get-option.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,20 @@
&reftitle.returnvalues;
<para>
This function returns &false; if <parameter>parser</parameter> does
not refer to a valid parser or if <parameter>option</parameter> isn't
valid (generates also a <constant>E_WARNING</constant>).
Else the option's value is returned.
not refer to a valid parser. Else the option's value is returned.
</para>
</refsect1>

<refsect1 role="errors">
&reftitle.errors;
<para>
Throws a <classname>ValueError</classname> when an invalid value is passed
to <parameter>option</parameter>.
</para>
<para>
Prior to PHP 8.0.0, passing an invalid value to
<parameter>option</parameter> generated a <constant>E_WARNING</constant>
as well as making the function return &false;.
</para>
</refsect1>

Expand All @@ -66,7 +77,14 @@
</row>
</thead>
<tbody>
&xml.changelog.parser-param;
&xml.changelog.parser-param;
<row>
<entry>8.0.0</entry>
<entry>
A <classname>ValueError</classname> is now thrown if
<parameter>option</parameter> is invalid.
</entry>
</row>
<row>
<entry>7.1.24, 7.2.12, 7.3.0</entry>
<entry>
Expand Down
26 changes: 23 additions & 3 deletions reference/xml/functions/xml-parser-set-option.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,21 @@
&reftitle.returnvalues;
<para>
This function returns &false; if <parameter>parser</parameter> does not
refer to a valid parser, or if the option could not be set. Else the
option is set and &true; is returned.
refer to a valid parser. Else the option's is set and &true; is returned.
</para>
</refsect1>

<refsect1 role="errors">
&reftitle.errors;
<para>
Throws a <classname>ValueError</classname> when an invalid value is passed
to <parameter>option</parameter>.
</para>
<para>
Prior to PHP 8.0.0, the function returned false when passing an invalid
value to
<parameter>option</parameter> generated a <constant>E_WARNING</constant>
as well as making the function return &false;.
</para>
</refsect1>

Expand All @@ -123,7 +136,14 @@
</row>
</thead>
<tbody>
&xml.changelog.parser-param;
&xml.changelog.parser-param;
<row>
<entry>8.0.0</entry>
<entry>
A <classname>ValueError</classname> is now thrown if
<parameter>option</parameter> is invalid.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
Expand Down

0 comments on commit 98b4495

Please sign in to comment.