I think a regex here would be more clear and succint, e.g.

    if ( preg_match( '/^id_([^_]+)/', $parsedUrl['path'], $match) ) {
        return new static( $matches[1] );
    }