|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
31 + 42 = ?
Subscribe to this entry?

 [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: Sun Apr 14 08:01:29 2024 UTC