Cannot instantiate enum %s

Description

Enumeration cannot be instantiated directly.

An enumeration object is created automatically when reading one of its case.

Example

<?php

enum E {
     case A;
}

//Cannot instantiate enum E
new E();

// E
print get_class(E::A);

?>

Literal Examples

  • Cannot instantiate enum e

Solutions

  • Use one of the enumeration cases.