You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dom\HTMLDocument parser mangles xml:space and xml:lang attributes #21486
changed the title [-]Dom\HTMLDocument parser mangles xml:space attribute[/-][+]Dom\HTMLDocument parser mangles xml:space and xml:lang attributes[/+]on Mar 21, 2026
Activity
[-]Dom\HTMLDocument parser mangles xml:space attribute[/-][+]Dom\HTMLDocument parser mangles xml:space and xml:lang attributes[/+]Oleh8978 commentedon Mar 21, 2026
Reproduced on PHP 8.5.3 (CLI) built via Homebrew on macOS.
Output:
space NULL
Expected xml namespace to be preserved (xml:space with proper namespace URI).
Oleh8978 commentedon Mar 21, 2026
Reproduced on PHP 8.5.3 (CLI, Homebrew, macOS).
HTML parsing (Dom\HTMLDocument):
space NULL
XML parsing (DOMDocument::loadXML):
xml:space
http://www.w3.org/XML/1998/namespace
This suggests the issue is specific to Dom\HTMLDocument (HTML parsing), where the xml namespace prefix is dropped and namespaceURI is lost.
Fix phpGH-21486: Dom\HTMLDocument parser mangles xml:space and xml:la…
Fix GH-21486: Dom\HTMLDocument parser mangles xml:space and xml:lang …
Merge branch 'PHP-8.4' into PHP-8.5
Merge branch 'PHP-8.5'