Skip to content

ext/zip: Make ZipArchive non-serializable#22237

Open
k2gl wants to merge 1 commit into
php:masterfrom
k2gl:fix-gh21682-zip-not-serializable
Open

ext/zip: Make ZipArchive non-serializable#22237
k2gl wants to merge 1 commit into
php:masterfrom
k2gl:fix-gh21682-zip-not-serializable

Conversation

@k2gl
Copy link
Copy Markdown

@k2gl k2gl commented Jun 5, 2026

A ZipArchive wraps a libzip resource that cannot survive serialization, so unserialize() silently produced a broken object (numFiles = 0) instead of erroring. This marks the class as not-serializable, consistent with Socket, CurlHandle and the Dba classes.

Fixes GH-21682

A ZipArchive wraps a libzip resource that cannot survive serialization,
so unserialize() silently produced a broken object (numFiles = 0) instead
of erroring. Mark the class as not-serializable, consistent with Socket,
CurlHandle and the Dba classes.

Fixes phpGH-21682
@k2gl k2gl force-pushed the fix-gh21682-zip-not-serializable branch from 5f927a3 to 8fe20ce Compare June 5, 2026 19:47
@k2gl k2gl requested a review from bukka as a code owner June 5, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZipArchive is missing the NOT_SERIALIZABLE flag

1 participant