Skip to content

Handle Windows Extended-Length Path Prefix (\\?\) #4

@roxblnfk

Description

@roxblnfk

When creating a Path from a string containing the Windows extended-length prefix \\?\, it should be automatically stripped during normalization.

Example

$path = Path::create('\\?\D:\git\project\src\File.php');

echo (string) $path;
// Expected: 'D:/git/project/src/File.php'

Why this happens

This prefix is returned by external tools (Rust, Go, .NET) that use Windows API for path canonicalization. It allows paths longer than 260 chars but is rarely needed in PHP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions