Skip to content

DOMNode::C14N doesn't corrently handle null xpath on PHP 7.x #8096

@nach-code

Description

@nach-code

DOMNode::C14N when not using an $xpath doesn't work correctly with PHPStan on PHP 7.x.

https://phpstan.org/r/5a2df335-43be-4ec2-8f64-6243d3ca60b9

This reports: Parameter #3 $xpath of method DOMNode::C14N() expects array, null given.

However, the null is allowed there:

php --rf DOMNode::C14N
Method [ <internal:dom> public method C14N ] {

  - Parameters [4] {
    Parameter #0 [ <optional> $exclusive ]
    Parameter #1 [ <optional> $with_comments ]
    Parameter #2 [ <optional> array or NULL $xpath ]
    Parameter #3 [ <optional> array or NULL $ns_prefixes ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions