note 126724 added to language.enumerations.basics

From: Date: Wed, 29 Dec 2021 08:08:16 +0000
Subject: note 126724 added to language.enumerations.basics
Groups: php.notes 
Request: Send a blank email to php-notes+get-217434@lists.php.net to get a copy of this message
<?php enum Colors { case Red; case Blue; case Green; public function getColor(): string { return $this->name; } } function paintColor(Colors $colors): void { echo "Paint : " . $colors->getColor() . PHP_EOL; } paintColor(Colors::Red); paintColor(Colors::Green); paintColor(Colors::Blue); /* output : ------------------------ Paint : Red Paint : Green Paint : Blue */ ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.135 (proxied: 185.169.233.111) ---- Manual Page -- https://php.net/manual/en/language.enumerations.basics.php Edit -- https://main.php.net/note/edit/126724 Del: integrated -- https://main.php.net/note/delete/126724/integrated Del: useless -- https://main.php.net/note/delete/126724/useless Del: bad code -- https://main.php.net/note/delete/126724/bad+code Del: spam -- https://main.php.net/note/delete/126724/spam Del: non-english -- https://main.php.net/note/delete/126724/non-english Del: in docs -- https://main.php.net/note/delete/126724/in+docs Del: other reasons-- https://main.php.net/note/delete/126724 Reject -- https://main.php.net/note/reject/126724 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#217434) next »