reference/xml/functions/xml-parser-set-option.xml
9fb00a4cf8563ea56d53cb1f72e2856b68899646
...
...
@@ -12,7 +12,7 @@
12
12
<type>bool</type><methodname>xml_parser_set_option</methodname>
13
13
<methodparam><type>XMLParser</type><parameter>parser</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>option</parameter></methodparam>
15
-
<methodparam><type class="union"><type>string</type><type>int</type></type><parameter>value</parameter></methodparam>
15
+
<methodparam><type class="union"><type>string</type><type>int</type><type>bool</type></type><parameter>value</parameter></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
Sets an option in an XML parser.
...
...
@@ -52,7 +52,7 @@
52
52
<tbody>
53
53
<row>
54
54
<entry><constant>XML_OPTION_CASE_FOLDING</constant></entry>
55
-
<entry>integer</entry>
55
+
<entry>bool</entry>
56
56
<entry>
57
57
Controls whether <link
58
58
linkend="xml.case-folding">case-folding</link> is enabled for this
...
...
@@ -69,7 +69,7 @@
69
69
</row>
70
70
<row>
71
71
<entry><constant>XML_OPTION_SKIP_WHITE</constant></entry>
72
-
<entry>integer</entry>
72
+
<entry>bool</entry>
73
73
<entry>
74
74
Whether to skip values consisting of whitespace characters.
75
75
</entry>
...
...
@@ -106,9 +106,21 @@
106
106
<refsect1 role="returnvalues">
107
107
&reftitle.returnvalues;
108
108
<para>
109
-
This function returns &false; if <parameter>parser</parameter> does not
110
-
refer to a valid parser, or if the option could not be set. Else the
111
-
option is set and &true; is returned.
109
+
Returns &true; on success or &false; on failure.
110
+
</para>
111
+
</refsect1>
112
+

113
+
<refsect1 role="errors">
114
+
&reftitle.errors;
115
+
<para>
116
+
Throws a <classname>ValueError</classname> when an invalid value is passed
117
+
to <parameter>option</parameter>.
118
+
</para>
119
+
<para>
120
+
Prior to PHP 8.0.0, the function returned false when passing an invalid
121
+
value to
122
+
<parameter>option</parameter> generated a <constant>E_WARNING</constant>
123
+
as well as making the function return &false;.
112
124
</para>
113
125
</refsect1>
114
126

...
...
@@ -123,7 +135,22 @@
123
135
</row>
124
136
</thead>
125
137
<tbody>
126
-
&xml.changelog.parser-param;
138
+
<row>
139
+
<entry>8.3.0</entry>
140
+
<entry>
141
+
The <parameter>value</parameter> parameter now also accepts booleans.
142
+
The options <constant>XML_OPTION_CASE_FOLDING</constant> and <constant>XML_OPTION_SKIP_WHITE</constant>
143
+
are now boolean options.
144
+
</entry>
145
+
</row>
146
+
&xml.changelog.parser-param;
147
+
<row>
148
+
<entry>8.0.0</entry>
149
+
<entry>
150
+
A <classname>ValueError</classname> is now thrown if
151
+
<parameter>option</parameter> is invalid.
152
+
</entry>
153
+
</row>
127
154
</tbody>
128
155
</tgroup>
129
156
</informaltable>
130
157