|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80599 Docs are not updated
Submitted: 2021-01-06 19:11 UTC Modified: 2021-01-09 11:10 UTC
From: jules dot bernable at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Systems problem
PHP Version: Irrelevant OS: debian
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: jules dot bernable at gmail dot com
New email:
PHP Version: OS:


 [2021-01-06 19:11 UTC] jules dot bernable at gmail dot com
In addition to

The signature for the following methods :

* hasAttributeNS
* getAttributeNS
* setAttributeNS
* removeAttributeNS
* getAttributeNodeNS

Report their first argument as a nullable string. This is not what is documented and passing null as the first argument to these method do throw a TypeError.

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

$el = new class('foo') extends DOMElement {
  public function hasAttributeNS(string $namespace , string $localName): bool {
    return true;

$el = new class('foo') extends DOMElement {
  public function getAttributeNS(string $namespace , string $localName): string {
    return 'bar';

$el = new class('foo') extends DOMElement {
  public function setAttributeNS(string $namespace, string $qualifiedName, string $value): void {}

// etc...

Actual result:
PHP Fatal error:  Declaration of DOMElement@anonymous::hasAttributeNS(string $namespaceURI, string $localName): bool must be compatible with DOMElement::hasAttributeNS(?string $namespace, string $localName) in ...

PHP Fatal error:  Declaration of DOMElement@anonymous::getAttributeNS(string $namespaceURI, string $localName): string must be compatible with DOMElement::getAttributeNS(?string $namespace, string $localName) in ...

PHP Fatal error:  Declaration of DOMElement@anonymous::setAttributeNS(string $namespace, string $qualifiedName, string $value): void must be compatible with DOMElement::setAttributeNS(?string $namespace, string $qualifiedName, string $value) in ...

// etc...


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-06 23:39 UTC]
-Summary: Wrong type signature for DOMElement methods +Summary: Docs are not updated -Status: Open +Status: Verified -Package: DOM XML related +Package: Systems problem -PHP Version: 8.0.0 +PHP Version: Irrelevant
 [2021-01-06 23:39 UTC]
Calling these methods with null as first argument is supported[1],
and the docs have been already fixed[2]. However, they are
currently not rolled out to the main site[3].

[1] <>
[2] <>
[3] <>
 [2021-01-06 23:39 UTC]
The following pull request has been associated:

Patch Name: Fix rsync
On GitHub:
 [2021-01-09 11:10 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-01-09 11:10 UTC]
This issue has been resolved.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 01:01:24 2023 UTC