|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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: Mon Apr 15 03:01:28 2024 UTC