Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dom\HTMLElement::getElementsByClassName() not implemented #18550

Copy link
Copy link
Open
@cscott

Description

@cscott
Issue body actions

Description

The following code:

<?php
$doc = Dom\HTMLDocument::createFromString('');
$el = $doc->createElement('div');
$el->getElementsByClassName('foo');
echo("Success.\n");

Resulted in this output:

Error  Call to undefined method Dom\HTMLElement::getElementsByClassName().

But I expected this output instead:

Success.

Documentation for this method is at: https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName
and it is standardized at https://dom.spec.whatwg.org/#ref-for-dom-element-getelementsbyclassname

PHP Version

PHP 8.4.6 (cli) (built: Apr 11 2025 02:19:40) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.6, Copyright (c), by Zend Technologies

Operating System

Ubuntu 24.04.2 LTS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.