Skip to content

Commit 9cd8eb0

Browse files
authored
PHP 8.4: xml_set_*() deprecations and changes (#4067)
1 parent f414967 commit 9cd8eb0

11 files changed

+70
-11
lines changed

language-snippets.ent

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4488,7 +4488,13 @@ xmlns="http://docbook.org/ns/docbook"><simpara>This function has been
44884488
</varlistentry>'>
44894489

44904490
<!ENTITY xml.handler.description '<para xmlns="http://docbook.org/ns/docbook">
4491-
If &null; or an empty string is passed, the handler is reset to its default state.
4491+
If &null; is passed, the handler is reset to its default state.
4492+
<warning>
4493+
<simpara>
4494+
An empty string will also reset the handler,
4495+
however this is deprecated as of PHP 8.4.0.
4496+
</simpara>
4497+
</warning>
44924498
</para>
44934499
<para xmlns="http://docbook.org/ns/docbook">
44944500
If <parameter>handler</parameter> is a <type>callable</type>,
@@ -4498,7 +4504,23 @@ xmlns="http://docbook.org/ns/docbook"><simpara>This function has been
44984504
If <parameter>handler</parameter> is a <type>string</type>,
44994505
it can be the name of a method of an object set with
45004506
<function>xml_set_object</function>.
4501-
</para>'>
4507+
<warning>
4508+
<simpara>
4509+
This is deprecated as of PHP 8.4.0.
4510+
</simpara>
4511+
</warning>
4512+
</para>
4513+
<warning xmlns="http://docbook.org/ns/docbook">
4514+
<simpara>
4515+
As of PHP 8.4.0, the callable is checked to be valid while setting the handler,
4516+
not when it is called.
4517+
This means that <function>xml_set_object</function> must be called prior to
4518+
setting a method string as the callback.
4519+
However, as this behaviour is also deprecated as of PHP 8.4.0,
4520+
using a proper <type>callable</type> for the method is recommended instead.
4521+
</simpara>
4522+
</warning>
4523+
'>
45024524

45034525
<!ENTITY xml.handler.parser.param '<varlistentry xmlns="http://docbook.org/ns/docbook">
45044526
<term><parameter>parser</parameter></term>
@@ -4509,6 +4531,22 @@ xmlns="http://docbook.org/ns/docbook"><simpara>This function has been
45094531
</listitem>
45104532
</varlistentry>'>
45114533

4534+
<!ENTITY xml.changelog.handler-param '<row xmlns="http://docbook.org/ns/docbook">
4535+
<entry>8.4.0</entry>
4536+
<entry>
4537+
Passing a non-<type>callable</type> <type>string</type> to
4538+
<parameter>handler</parameter> is now deprecated,
4539+
use a proper callable for methods, or &null; to reset the handler.
4540+
</entry>
4541+
</row>
4542+
<row xmlns="http://docbook.org/ns/docbook">
4543+
<entry>8.4.0</entry>
4544+
<entry>
4545+
The validity of <parameter>handler</parameter> as a <type>callable</type>
4546+
is now checked when setting the handler instead of checking when calling it.
4547+
</entry>
4548+
</row>'>
4549+
45124550
<!ENTITY xml.changelog.parser-param '<row xmlns="http://docbook.org/ns/docbook">
45134551
<entry>8.0.0</entry>
45144552
<entry>

reference/xml/functions/xml-set-character-data-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
</row>
7777
</thead>
7878
<tbody>
79-
&xml.changelog.parser-param;
79+
&xml.changelog.handler-param;
80+
&xml.changelog.parser-param;
8081
</tbody>
8182
</tgroup>
8283
</informaltable>

reference/xml/functions/xml-set-default-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575
</row>
7676
</thead>
7777
<tbody>
78-
&xml.changelog.parser-param;
78+
&xml.changelog.handler-param;
79+
&xml.changelog.parser-param;
7980
</tbody>
8081
</tgroup>
8182
</informaltable>

reference/xml/functions/xml-set-element-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125
</row>
126126
</thead>
127127
<tbody>
128-
&xml.changelog.parser-param;
128+
&xml.changelog.handler-param;
129+
&xml.changelog.parser-param;
129130
</tbody>
130131
</tgroup>
131132
</informaltable>

reference/xml/functions/xml-set-end-namespace-decl-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
</row>
8181
</thead>
8282
<tbody>
83-
&xml.changelog.parser-param;
83+
&xml.changelog.handler-param;
84+
&xml.changelog.parser-param;
8485
</tbody>
8586
</tgroup>
8687
</informaltable>

reference/xml/functions/xml-set-external-entity-ref-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
</row>
112112
</thead>
113113
<tbody>
114-
&xml.changelog.parser-param;
114+
&xml.changelog.handler-param;
115+
&xml.changelog.parser-param;
115116
<row>
116117
<entry>7.3.0</entry>
117118
<entry>

reference/xml/functions/xml-set-notation-decl-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@
116116
</row>
117117
</thead>
118118
<tbody>
119-
&xml.changelog.parser-param;
119+
&xml.changelog.handler-param;
120+
&xml.changelog.parser-param;
120121
</tbody>
121122
</tgroup>
122123
</informaltable>

reference/xml/functions/xml-set-object.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<refname>xml_set_object</refname>
66
<refpurpose>Use XML Parser within an object</refpurpose>
77
</refnamediv>
8+
9+
<refsynopsisdiv>
10+
&warn.deprecated.function-8-4-0;
11+
</refsynopsisdiv>
812

913
<refsect1 role="description">
1014
&reftitle.description;
@@ -63,6 +67,14 @@
6367
</row>
6468
</thead>
6569
<tbody>
70+
<row>
71+
<entry>8.4.0</entry>
72+
<entry>
73+
This function is now deprecated,
74+
instead pass proper <type>callable</type> values to
75+
<function>xml_set_</function>
76+
</entry>
77+
</row>
6678
&xml.changelog.parser-param;
6779
</tbody>
6880
</tgroup>

reference/xml/functions/xml-set-processing-instruction-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ data
104104
</row>
105105
</thead>
106106
<tbody>
107-
&xml.changelog.parser-param;
107+
&xml.changelog.handler-param;
108+
&xml.changelog.parser-param;
108109
</tbody>
109110
</tgroup>
110111
</informaltable>

reference/xml/functions/xml-set-start-namespace-decl-handler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
</row>
8585
</thead>
8686
<tbody>
87-
&xml.changelog.parser-param;
87+
&xml.changelog.handler-param;
88+
&xml.changelog.parser-param;
8889
</tbody>
8990
</tgroup>
9091
</informaltable>

0 commit comments

Comments
 (0)