[GIT-PULLS] [php-src] PR #23282: Fix GH-23276: Collect ZipArchive subclasses holding their own streams

[email protected] (LamentXU123)
Newsgroups php.git-pulls
Message-ID <qBaQKAjI2gMCPSOYM3pK6tEqnqz9sunTNN9b1ckZKSI@main.internal.php.net>
Pull Request: https://github.com/php/php-src/pull/23282
Author: LamentXU123

I actually doubt this is a bug in the Zend engine. But since I am not familiar of how Zend GC works, I'd fix this is a completely ext/zip way, to replace the stream's reference to the `ZipArchive` object with a refcounted archive state, so a stream can keep the underlying `zip_t` without preventing its owning `ZipArchive` object from being GC-ed.

There can be better fixes, as I said, to fix in the Zend engine. But I think this is a very rare case happening in the zip extension, so I'd rather re-implement it than touching Zend core, so we don't bother other code.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.