ZIP Archive for multiple batch exports fail
There is an issue with the ZipArchive class' open() method. In previous versions of PHP when the only flag passed to the method was the ZipArchive::OVERWRITE, the method also created non-existing archives.
Since PHP 5.6 the OVERWRITE flag alone cannot create new archives which breaks compatibility.
Test script:
// Open new archive in cwd based on timestamp
$zip = new ZipArchive();
$open = $zip->open(time() . '.zip', ZipArchive::OVERWRITE);
echo $open;
Expected result:
Expected behavior: The new archive is opened as in the previous version.
Actual result:
In PHP 5.5 an empty archive is opened.
In PHP 5.6 ZipArchive::ER_OPEN error code is returned (cannot open zip file).