- Output for 8.1.23 - 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- string(23) "What is your situation?"
<?php declare(strict_types = 1);
interface SurveyAnswerInterface extends BackedEnum
{
public static function getQuestion(): string;
}
enum SituationAnswer: string implements SurveyAnswerInterface
{
case NEW = 'new';
case OLD = 'old';
public static function getQuestion(): string
{
return 'What is your situation?';
}
}
var_dump(SituationAnswer::NEW::getQuestion());