mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
24 lines
624 B
PHP
24 lines
624 B
PHP
--TEST--
|
|
Enum must not implement Serializable
|
|
--FILE--
|
|
<?php
|
|
|
|
enum Foo implements Serializable {
|
|
case Bar;
|
|
|
|
public function serialize() {
|
|
return serialize('Hello');
|
|
}
|
|
|
|
public function unserialize($data) {
|
|
return unserialize($data);
|
|
}
|
|
}
|
|
|
|
var_dump(unserialize(serialize(Foo::Bar)));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
|
|
|
Fatal error: Enum Foo cannot implement the Serializable interface in %s on line %d
|