note 126857 added to language.types.enumerations
| From: | den4ic2001 at gmail dot com | Date: | Wed, 16 Feb 2022 13:17:43 +0000 |
| Subject: | note 126857 added to language.types.enumerations | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217623@lists.php.net to get a copy of this message | ||
// You can explicitly specify a scalar type
enum Color: string {
case Red = "#fc0505";
case Black = "B";
case White = "W";
}
print Color::Red->name; // retirn string âRedâ
print Color::Red->value; //retirn string âRâ
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 109.127.133.119)
----
Manual Page -- https://php.net/manual/en/language.types.enumerations.php
Edit -- https://main.php.net/note/edit/126857
Del: integrated -- https://main.php.net/note/delete/126857/integrated
Del: useless -- https://main.php.net/note/delete/126857/useless
Del: bad code -- https://main.php.net/note/delete/126857/bad+code
Del: spam -- https://main.php.net/note/delete/126857/spam
Del: non-english -- https://main.php.net/note/delete/126857/non-english
Del: in docs -- https://main.php.net/note/delete/126857/in+docs
Del: other reasons-- https://main.php.net/note/delete/126857
Reject -- https://main.php.net/note/reject/126857
Search -- https://main.php.net/manage/user-notes.php