This breaks if `null === $path`, which is potentially possible.

/cc @Maks3w