reference/xml/functions/xml-parser-get-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-get-option">
3
+
<refentry xml:id="function.xml-parser-get-option" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>xml_parser_get_option</refname>
6
6
<refpurpose>Get options from an XML parser</refpurpose>
...
...
@@ -9,8 +9,8 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>xml_parser_get_option</methodname>
13
-
<methodparam><type>resource</type><parameter>parser</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>int</type><type>bool</type></type><methodname>xml_parser_get_option</methodname>
13
+
<methodparam><type>XMLParser</type><parameter>parser</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>option</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
...
...
@@ -34,7 +34,8 @@
34
34
<term><parameter>option</parameter></term>
35
35
<listitem>
36
36
<simpara>
37
-
Which option to fetch. <constant>XML_OPTION_CASE_FOLDING</constant>
37
+
Which option to fetch. <constant>XML_OPTION_CASE_FOLDING</constant>,
38
+
<constant>XML_OPTION_SKIP_TAGSTART</constant>, <constant>XML_OPTION_SKIP_WHITE</constant>
38
39
and <constant>XML_OPTION_TARGET_ENCODING</constant> are available.
39
40
See <function>xml_parser_set_option</function> for their description.
40
41
</simpara>
...
...
@@ -47,15 +48,61 @@
47
48
<refsect1 role="returnvalues">
48
49
&reftitle.returnvalues;
49
50
<para>
50
-
This function returns &false; if <parameter>parser</parameter> does
51
-
not refer to a valid parser or if <parameter>option</parameter> isn't
52
-
valid (generates also a <constant>E_WARNING</constant>).
53
-
Else the option's value is returned.
51
+
Returns the option's value.
54
52
</para>
55
53
</refsect1>
56
54

57
-
</refentry>
55
+
<refsect1 role="errors">
56
+
&reftitle.errors;
57
+
<para>
58
+
Throws a <classname>ValueError</classname> when an invalid value is passed
59
+
to <parameter>option</parameter>.
60
+
</para>
61
+
<para>
62
+
Prior to PHP 8.0.0, passing an invalid value to
63
+
<parameter>option</parameter> generated a <constant>E_WARNING</constant>
64
+
as well as making the function return &false;.
65
+
</para>
66
+
</refsect1>
67
+

68
+
<refsect1 role="changelog">
69
+
&reftitle.changelog;
70
+
<informaltable>
71
+
<tgroup cols="2">
72
+
<thead>
73
+
<row>
74
+
<entry>&Version;</entry>
75
+
<entry>&Description;</entry>
76
+
</row>
77
+
</thead>
78
+
<tbody>
79
+
<row>
80
+
<entry>8.3.0</entry>
81
+
<entry>
82
+
The function now returns a boolean for boolean options.
83
+
</entry>
84
+
</row>
85
+
&xml.changelog.parser-param;
86
+
<row>
87
+
<entry>8.0.0</entry>
88
+
<entry>
89
+
A <classname>ValueError</classname> is now thrown if
90
+
<parameter>option</parameter> is invalid.
91
+
</entry>
92
+
</row>
93
+
<row>
94
+
<entry>7.1.24, 7.2.12, 7.3.0</entry>
95
+
<entry>
96
+
<parameter>options</parameter> now supports <constant>XML_OPTION_SKIP_TAGSTART</constant>
97
+
and <constant>XML_OPTION_SKIP_WHITE</constant>.
98
+
</entry>
99
+
</row>
100
+
</tbody>
101
+
</tgroup>
102
+
</informaltable>
103
+
</refsect1>
58
104

105
+
</refentry>
59
106
<!-- Keep this comment at the end of the file
60
107
Local variables:
61
108
mode: sgml
62
109