[php-src] Issue #9504: serialization fatal error and deprecation
| From: | staabm | Date: | Thu, 08 Sep 2022 08:17:40 +0000 |
| Subject: | [php-src] Issue #9504: serialization fatal error and deprecation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242379@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9504
Author: staabm
### Description
The following code:
```php
<?php
<?php // lint >= 8.1
namespace MissingMagicSerializationMethods;
use Serializable;
enum myEnum implements Serializable {
case X;
case Y;
public function serialize() {
}
public function unserialize($data) {
}
}
```
Resulted in this output:
```
Deprecated: MissingMagicSerializationMethods\myEnum implements the Serializable interface, which is
deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old
PHP versions is necessary) in /in/tKdD6 on line 8
Fatal error: Enum MissingMagicSerializationMethods\myEnum cannot implement the Serializable
interface in /in/tKdD6 on line 8
```
But I expected this output instead:
- no deprecation message, as its already a fatal error
https://3v4l.org/tKdD6
### PHP Version
8.1+
### Operating System
_No response_