Hello,
UPDATE: addHeaderSection and addFooterSection allow adding headers and footers per section. These methods include the removeOthers option to keep or remove existing headers and footers when adding new ones.
addHeader and addFooter methods only work with a single section. For this reason, the mergeDocx method available in Advanced and Premium licenses is needed to generate documents with multiple sections with different headers and footers (https://www.phpdocx.com/documentation/cookbook/headers-and-footers-for-sections).
If you need to overwrite headers or footers in a DOCX that contains one section, please note you may need to set all scopes (not only the default scope):
$docx->addFooter(array('default' => $numbering, 'first' => $numbering, 'even' => $numbering));
If you need to overwrite headers or footers in a DOCX that contains one or more sections, you can use the importHeadersAndFooters method (importing a DOCX that also includes all scopes of the headers/footers to be added: default, first, even):
$docx->importHeadersAndFooters('docx_footer.docx');
Regards.