(return array_pop($path) is easier to understand)