If you open archive without flags in PHP 5.6 then you can get errors on close:
Warning: ZipArchive::close(): Zip archive inconsistent in
And changes not saved.
You need use flag ZIPARCHIVE::OVERWRITE on $zip->open.
This issue happens for me only in php 5.6. In php 5.4 and before it works without any flags to $zip->open.