Skip to content

First parameter of DOMDocument::saveXML is allowed to be null #1974

@waahhhh

Description

@waahhhh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions