Proposal: $options argument for SimpleXMLElement::asXML

From: Date: Sat, 09 Sep 2023 20:05:37 +0000
Subject: Proposal: $options argument for SimpleXMLElement::asXML
Groups: php.internals 
Request: Send a blank email to internals+get-121027@lists.php.net to get a copy of this message
Hi internals I came across https://bugs.php.net/bug.php?id=67387. Passing the option in via the constructor doesn't work because the constructor only allows parser options. We can implement support for options (such as LIBXML_NOXMLDECL, LIBXML_SAVE_NOEMPTYTAG) by adding an (optional) argument to the asXML function: ?int $options = 0. This would be a BC break, because userland classes extending from SimpleXMLElement *and* overriding asXML would have to change the signature of asXML. It's not hard at all to implement this functionality, but I want to ask first if there's any opinions on this before I write up an RFC. Thanks Niels

« previous php.internals (#121027) next »