3v4l.org

run code in 300+ PHP versions simultaneously
<?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());
Output for 8.1.23 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
string(23) "What is your situation?"

preferences:
60.07 ms | 844 KiB | 4 Q