note 128884 added to language.enumerations.static-methods
| From: | Anonymous at main dot php dot net | Date: | Thu, 14 Sep 2023 13:16:15 +0000 |
| Subject: | note 128884 added to language.enumerations.static-methods | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220844@lists.php.net to get a copy of this message | ||
<?php
enum Suit: string
{
case Hearts = 'H';
case Diamonds = 'D';
case Clubs = 'C';
case Spades = 'S';
public static function forSelect(): array
{
return array_column(self::cases(), 'name', 'value');
}
}
var_dump(Suit::forSelect());
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 2604:a840:3::206d)
----
Manual Page -- https://php.net/manual/en/language.enumerations.static-methods.php
Edit -- https://main.php.net/note/edit/128884
Del: integrated -- https://main.php.net/note/delete/128884/integrated
Del: useless -- https://main.php.net/note/delete/128884/useless
Del: bad code -- https://main.php.net/note/delete/128884/bad+code
Del: spam -- https://main.php.net/note/delete/128884/spam
Del: non-english -- https://main.php.net/note/delete/128884/non-english
Del: in docs -- https://main.php.net/note/delete/128884/in+docs
Del: other reasons-- https://main.php.net/note/delete/128884
Reject -- https://main.php.net/note/reject/128884
Search -- https://main.php.net/manage/user-notes.php