Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88326 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55614 invoked from network); 18 Sep 2015 14:23:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2015 14:23:44 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.89 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.89 blu004-omc2s14.hotmail.com Received: from [65.55.111.89] ([65.55.111.89:64132] helo=BLU004-OMC2S14.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/1B-19961-E6E1CF55 for ; Fri, 18 Sep 2015 10:23:43 -0400 Received: from BLU436-SMTP6 ([65.55.111.72]) by BLU004-OMC2S14.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 18 Sep 2015 07:23:40 -0700 X-TMN: [WhOBKBaA096XD1WdCtejXOyhStC14DU4] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) In-Reply-To: <7726D162-4710-44BE-A1D0-44C2715D4160@gmail.com> Date: Fri, 18 Sep 2015 16:23:35 +0200 CC: PHP internals Content-Transfer-Encoding: quoted-printable References: <55FB4791.4040807@gmail.com> <55FB533F.7080301@gmail.com> <7726D162-4710-44BE-A1D0-44C2715D4160@gmail.com> To: Rowan Collins X-Mailer: Apple Mail (2.2104) X-OriginalArrivalTime: 18 Sep 2015 14:23:38.0021 (UTC) FILETIME=[9C130550:01D0F21D] Subject: Re: [PHP-DEV] Let's discuss enums! From: bobwei9@hotmail.com (Bob Weinand) > Am 18.09.2015 um 10:42 schrieb Rowan Collins = : >=20 > On 18 September 2015 01:15:43 BST, Bob Weinand = wrote: >> The reason it is not an associative array is that the names are not >> important. > ... >> You never should *rely* on the ordinal value of the enum for = anything. >=20 > I feel like I'm missing something here. In my mind, the only absolute = universal about all enum implementations is that you refer to values by = constant names - e.g. Weekdays::SUNDAY. The name 'SUNDAY' is as = fundamental and unchanging as the name 'Weekdays'. >=20 > We rely on names to reference classes and functions all the time, and = to serialize properties of an object; so what is it about enums that = makes having an integer accessible so important? >=20 > I note that Java does supply an ordinal(), but the docs say you should = basically never use it. >=20 > Regards, > --=20 > Rowan Collins > [IMSoP] Well, I think we should *either* have an ordinal *or* a name. But not both. Currently, after thinking about it, I'm in favor of just a name. And no = ordinal. Having both is, I think, unnecessary. Bob=