php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80494 DOMElement::remove not documented
Submitted: 2020-12-08 11:19 UTC Modified: 2020-12-08 11:43 UTC
From: contact at perryrylance dot com Assigned:
Status: Open Package: Documentation problem
PHP Version: 8.0.0 OS: Windows 10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-12-08 11:19 UTC] contact at perryrylance dot com
Description:
------------
I have a library which extends DOMElement.

My library adds DOMElement::remove for convenience.

After installing PHP 8 my library creates a fatal error.

The function definition I have for ExampleElement::remove does not match DOMElement::remove.

Not a biggie - I can simply change the function definition to match, *however*, the PHP manual does not document this function.

Test script:
---------------
<?php

class ExampleElement extends DOMElement
{
    public function remove()
    {
    }
}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-08 11:28 UTC] beberlei@php.net
Right, this was part of the DOM Living Standard RFC https://wiki.php.net/rfc/dom_living_standard_api

I haven't gotten around to the documentation part yet :-( The signature is without paraemters:

public function delete();
 [2020-12-08 11:28 UTC] beberlei@php.net
I am sorry, i meant:

public function remove();
 [2020-12-08 11:30 UTC] beberlei@php.net
Sorry, I am having a bad day, the problem is not the parameters, but that the PHP 8 api has "void" as return type, so my last attempt, this time its right :-)

public function remove(): void;

As a side-note, PHP 8 now contains so called stubs, that show the right signature directly in PHP code. See the DOM Extension and remove here: https://github.com/php/php-src/blob/master/ext/dom/php_dom.stub.php#L231
 [2020-12-08 11:43 UTC] contact at perryrylance dot com
Wonderful, thank you so much!

Looks like I can simply remove this from my implementation :)

Thanks again!
 [2021-02-03 06:03 UTC] janejenkins19844 at gmail dot com
I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks.



https://www.navyarmyccu.ltd/
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Mar 08 07:01:23 2021 UTC