reference/xml/functions/xml-parser-get-option.xml
9acfa18973f304f8f2d531f28dd12b12c2b84f8b
9acfa18973f304f8f2d531f28dd12b12c2b84f8b
...
...
@@ -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,9 @@
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_PARSE_HUGE</constant>,
39
+
<constant>XML_OPTION_SKIP_TAGSTART</constant>, <constant>XML_OPTION_SKIP_WHITE</constant>
38
40
and <constant>XML_OPTION_TARGET_ENCODING</constant> are available.
39
41
See <function>xml_parser_set_option</function> for their description.
40
42
</simpara>
...
...
@@ -47,15 +49,61 @@
47
49
<refsect1 role="returnvalues">
48
50
&reftitle.returnvalues;
49
51
<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.
52
+
Returns the option's value.
54
53
</para>
55
54
</refsect1>
56
55
57
-
</refentry>
56
+
<refsect1 role="errors">
57
+
&reftitle.errors;
58
+
<para>
59
+
Throws a <classname>ValueError</classname> when an invalid value is passed
60
+
to <parameter>option</parameter>.
61
+
</para>
62
+
<para>
63
+
Prior to PHP 8.0.0, passing an invalid value to
64
+
<parameter>option</parameter> generated a <constant>E_WARNING</constant>
65
+
as well as making the function return &false;.
66
+
</para>
67
+
</refsect1>
68
+
69
+
<refsect1 role="changelog">
70
+
&reftitle.changelog;
71
+
<informaltable>
72
+
<tgroup cols="2">
73
+
<thead>
74
+
<row>
75
+
<entry>&Version;</entry>
76
+
<entry>&Description;</entry>
77
+
</row>
78
+
</thead>
79
+
<tbody>
80
+
<row>
81
+
<entry>8.3.0</entry>
82
+
<entry>
83
+
The function now returns a boolean for boolean options.
84
+
</entry>
85
+
</row>
86
+
&xml.changelog.parser-param;
87
+
<row>
88
+
<entry>8.0.0</entry>
89
+
<entry>
90
+
A <classname>ValueError</classname> is now thrown if
91
+
<parameter>option</parameter> is invalid.
92
+
</entry>
93
+
</row>
94
+
<row>
95
+
<entry>7.1.24, 7.2.12, 7.3.0</entry>
96
+
<entry>
97
+
<parameter>options</parameter> now supports <constant>XML_OPTION_SKIP_TAGSTART</constant>
98
+
and <constant>XML_OPTION_SKIP_WHITE</constant>.
99
+
</entry>
100
+
</row>
101
+
</tbody>
102
+
</tgroup>
103
+
</informaltable>
104
+
</refsect1>
58
105
106
+
</refentry>
59
107
<!-- Keep this comment at the end of the file
60
108
Local variables:
61
109
mode: sgml
62
110