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

Case %s::%s does not exist

Description

This error is reported by the Reflection API, when trying to generate the informational object ReflectionEnumUnitCase, with a non-existing Case.

Example

<?php

enum E {
    case a;
}

$reflectionEnum = new ReflectionEnum(E::class);
$reflectionEnum->getCase('b');


?>

Literal Examples

  • Case E::b does not exist

Alternatives

  • Make sure the case exists before trying to instantiate its relate object.