reference/xml/functions/xml-parser-set-option.xml
9fb00a4cf8563ea56d53cb1f72e2856b68899646
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.xml-parser-set-option">
3
+
<refentry xml:id="function.xml-parser-set-option" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>xml_parser_set_option</refname>
6
6
<refpurpose>Set options in an XML parser</refpurpose>
...
...
@@ -10,9 +10,9 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>xml_parser_set_option</methodname>
13
-
<methodparam><type>resource</type><parameter>parser</parameter></methodparam>
13
+
<methodparam><type>XMLParser</type><parameter>parser</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>option</parameter></methodparam>
15
-
<methodparam><type>mixed</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,14 +106,57 @@
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.
112
110
</para>
113
111
</refsect1>
114
112

115
-
</refentry>
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;.
124
+
</para>
125
+
</refsect1>
116
126

127
+
<refsect1 role="changelog">
128
+
&reftitle.changelog;
129
+
<informaltable>
130
+
<tgroup cols="2">
131
+
<thead>
132
+
<row>
133
+
<entry>&Version;</entry>
134
+
<entry>&Description;</entry>
135
+
</row>
136
+
</thead>
137
+
<tbody>
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>
154
+
</tbody>
155
+
</tgroup>
156
+
</informaltable>
157
+
</refsect1>
158
+

159
+
</refentry>
117
160
<!-- Keep this comment at the end of the file
118
161
Local variables:
119
162
mode: sgml
120
163