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:
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
Reactions are currently unavailable
Description
The following code:
Resulted in this output:
But I expected this output instead:
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 TechnologiesOperating System
Ubuntu 24.04.2 LTS