Description
The following code:
<?php
$html = 'abc<def<br>g';
$dom = \Dom\HTMLDocument::createFromString($html, options: LIBXML_NOERROR | LIBXML_HTML_NOIMPLIED);
var_dump($dom->textContent);
$dom = new \DOMDocument(encoding: 'UTF-8');
$dom->loadHTML($html, LIBXML_NOERROR | LIBXML_HTML_NOIMPLIED);
var_dump($dom->textContent);
https://3v4l.org/t9WVN
Resulted in this output:
NULL
string(8) "abc<defg"
But I expected this output instead:
string(8) "abc<defg"
string(8) "abc<defg"
It may be not a bug, but in this case, how to simply get the same result ?
PHP Version
8.4.3
Operating System
No response