Summary of a problem or a feature request
An error occurs, when passing nullto DOMDocument::saveXML as first parameter.
The first parameter is allowed to be null.
See: https://github.com/php/php-src/blob/623911f993f39ebbe75abe2771fc89faf6b15b9b/ext/dom/document.c#L133
Code snippet that reproduces the problem
https://phpstan.org/r/0f320c77-e587-4a47-b4ee-ec3a83a005f7
Expected output
Using $dom->saveXML(null, LIBXML_NOEMPTYTAG); should be valid.