Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Enum %s cannot implement the Serializable interface

Description

Enumeration cannot be serialized: they are created as needed by the PHP engine, during execution, and they will again at the next execution.

Example

<?php

enum E implements Serializable {
    case A;
}

?>

Literal Examples

  • Enum E cannot implement the Serializable interface

Alternatives

  • Remove the serializable implements.
  • Make this enumeration a class.