Skip to content

Commit d61bc63

Browse files
committed
Change XMLWriter resources to objects
While we generally prefer objects over resources for quite a while, the procedural XMLWriter API still uses resources, although there is already an object-oriented API which uses objects. This dichotomy makes no sense, slightly complicates the implementation, and doesn't allow a stepwise migration to the object-oriented API, which might be desired. Thus we completely drop the XMLWriter resources in favor of XMLWriter objects. We consider the minor BC break acceptable for a major version, since only explicit type checks (`is_resource()`, `gettype()` etc.) need to be adapted.
1 parent 873b548 commit d61bc63

File tree

6 files changed

+190
-395
lines changed

6 files changed

+190
-395
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ PHP NEWS
4848
- XML:
4949
. Fixed bug #76874 (xml_parser_free() should never leak memory). (Nikita)
5050

51+
- XMLWriter:
52+
. Changed functions to accept/return XMKWriter objects instead of resources.
53+
(cmb)
54+
5155
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

UPGRADING

+4
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ PHP 8.0 UPGRADE NOTES
234234
instead the XmlParser instance is automatically destroyed if it is no longer
235235
referenced.
236236

237+
- XMLWriter:
238+
. The XMLWriter functions now accept and return, respectively, XMLWriter
239+
objects instead of resources.
240+
237241
- Zlib:
238242
. gzgetss() has been removed.
239243

0 commit comments

Comments
 (0)