[php-src] Issue #21682: ZipArchive is missing the NOT_SERIALIZABLE flag
[email protected] (arnaud-lb)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/21682
Author: arnaud-lb
### Description
The following code:
```php
$a = new ZipArchive();
var_dump($a->open('test.zip', ZipArchive::CREATE));
var_dump($a->addFromString('test.php', '<?php'));
var_dump($a->numFiles);
$a = unserialize(serialize($a));
echo "# Num files after serialize:\n";
var_dump($a->numFiles);
```
Resulted in this output:
```
[...]
# Num files after serialize:
int(0)
```
But I expected this output instead:
```
Fatal error: Uncaught Exception: Serialization of 'ZipArchive' is not allowed
```
Found by @nicolas-grekas
### PHP Version
```plain
*
```
### Operating System
_No response_