Given mapping:

    $mapping = array(
        "Foo\\Bar" => "/path/to/packages/foo-bar/src",
    );

And given filesystem:

    /path/to/packages/foo-bar/
        src/
            Baz.php       # Foo\Bar\Baz.php
            Qux/          # Foo\Bar\Qux
                Quux.php  # Foo\Bar\Qux\Quux.php
                Quux2.jpg # Foo\Bar\Qux\Quux2.jpg

Given the reference implementation for PSR Path Mapping:

    # $file = /path/to/packages/foo-bar/src/Baz.php
    $file = match_path('Foo\Bar\Baz.php', $mappings, '\\');

    # $file = /path/to/packages/foo-bar/src/Qux/Quux2.jpg
    $file = match_path('Foo\Bar\Qux\quux2.jpg', $mappings, '\\');

    # $dir = /path/to/packages/foo-bar/src/Qux
    $dir = match_path('Foo\Bar\Qux', $mappings, '\\');

So a a PSR-X autoloader could be written such that:

    spl_autoload_register(function ($class) use ($mappings) {
        if ($match = match_path($class.".php", $mappings, '\\')) {
            include $match;
        }
    });

    $baz = new Foo\Bar\Baz;

    // profit =)