Skip to content

PHP 8.6 | Undocumented change in DOMDocument::$documentURI value format on Windows #23326

Description

@jrfnl

Description

The following code:

<?php
// Where $doc is a DOMNode instance.
$fileName  = $doc->ownerDocument->documentURI;

Resulted in this output on PHP 8.6-beta1:

D:\path\to\PHP_CodeSniffer\tests\Core\Generators\Fixtures\StandardWithDocs\Docs\Content\DocumentationTitlePCREFallbackStandard.xml

But I expected this output instead:

file:/D:/path/to/PHP_CodeSniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitlePCREFallbackStandard.xml

... which has been the format for that property value since at least PHP 5.4.

It is unclear to me whether this is a deliberate change or an accidental side-effect of something.

If it is a deliberate change, please document the change in the UPGRADING file.
If it is an accidental side-effect/unintentional change, please mark this as a bug in PHP 8.6.

PHP Version

PHP 8.6.0beta1 (cli) (built: Aug 11 2026 17:58:37) (ZTS Visual C++ 2026 x64)
Copyright © The PHP Group and Contributors
Built by The PHP Group
Zend Engine v4.6.0-dev, Copyright © Zend by Perforce
    with Zend OPcache v8.6.0beta1, Copyright ©, by Zend by Perforce

Operating System

Windows 10

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