Re: PHP 7.1 - Address PHPSadness #28?
| From: | Rowan Collins | Date: | Thu, 17 Sep 2015 22:11:54 +0000 |
| Subject: | Re: PHP 7.1 - Address PHPSadness #28? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88290@lists.php.net to get a copy of this message | ||
On 17/09/2015 20:51, Rowan Collins wrote:
What would really be handy in a case like this is the ability to create your own null-like values, guaranteed to be distinct from all other values: type hidden extends \php\basetypes\terminal {} type default extends \php\basetypes\terminal {} $checklist = hidden; gettype($checklist); // 'hidden' $checklist == hidden; // true $checklist == deafult; // false isset($checklist); // trueI realised after I wrote it that this particular train of thought has basically led me to enums. *drafts new thread about adding enums to PHP* Regards, -- Rowan Collins [IMSoP]