|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80537 Wrong parameter type in DOMElement::removeAttributeNode stub
Submitted: 2020-12-21 08:48 UTC Modified: 2020-12-21 09:16 UTC
From: ondrej at mirtes dot cz Assigned: nikic (profile)
Status: Closed Package: Reflection related
PHP Version: 8.0.0 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ondrej at mirtes dot cz
New email:
PHP Version: OS:


 [2020-12-21 08:48 UTC] ondrej at mirtes dot cz
The stub for this method looks like this (

    /** @return DOMAttr|false */
    public function removeAttributeNode(string $qualifiedName) {}

But the method accepts DOMAttr:

PHP documentation agrees:

Originally reported as PHPStan bug:

Test script:
<?php declare(strict_types = 1);

$document = new DOMDocument();
$document->loadXML('<x a="foo"/>');
/** @var DOMElement $element */
$element = $document->documentElement;
$attribute = $element->getAttributeNode('a');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-21 09:16 UTC]
-Assigned To: +Assigned To: nikic
 [2020-12-21 09:23 UTC]
-Status: Assigned +Status: Closed
 [2020-12-21 09:23 UTC]
Automatic comment on behalf of
Log: Fix bug #80537
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 23:01:27 2024 UTC