I am calling a report multiple times within the same php context. When I do this with cloudexport I am getting a redeclaration error in file koolreport/cloudexport/vendor/chromeheadless/php-client/Exporter at line 122.
it seems the replaceUrls function is declared inside the saveTempContent function and is therefore not part of the Exporter class, so when chromeheadless is called again this function is already in the global space.
Moving the replaceUrls function to be part a function of the Exporter class and calling it with self::replaceUrls solves the problem.
Note: replaceUrls calls itself recursively so it is necessary to add the self:: to the recursive call within the function.