Skip to content

SimpleXMLElement::addChild different signature #7028

@szepeviktor

Description

@szepeviktor

Bug report

In PHPStan

'SimpleXMLElement::addChild' => ['static', 'name'=>'string', 'value='=>'string', 'ns='=>'string'],

In PHP documentation

public SimpleXMLElement::addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElement

When we give null as $value PHPStan raises an error.
I'd like to send a PR but how do I know in which PHP version was the change?

(PHP 5 >= 5.1.3, PHP 7, PHP 8)

Was it ?string from the beginning?
Please help me.

Expected output

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions