Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61003 invoked from network); 18 Sep 2015 14:49:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2015 14:49:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:33993] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/00-60254-5742CF55 for ; Fri, 18 Sep 2015 10:49:26 -0400 Received: by wicfx3 with SMTP id fx3so67577677wic.1 for ; Fri, 18 Sep 2015 07:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=Qg3KxX78acKWPusDOYGN1TBsMpZmJGkgrvUwytKqzgI=; b=qqBXppJ6pL6WchZfFqV9+aGQH7uw/7EaCOjJS48oBiNm8/Hfwcqk9yWi+b48H/hLF2 J5Hqii5g0rnlgfHey4irZ+YOnvjJiJE+pFDp/tv9M539vFCVFWdvUbKhYS1jUeg9VdRF dSFxm6IK9q9SVY7xIqeSpDCzBxNZ9RmfP9rxPsqulqiaD2+efDUGcP3A6xw5TAiV2wak fcYXOXj2K43eFgZq0tg06Z3NZnwX040qIG2rT3kn+bcB0MnkCVYZPh2qhyN74J1diW3U QXWKEQ89fGIEwd0FRZL8VYdbXDR6UFH6UyPFF4jivcJ491UZoRvuFYzEx9zydpUK5RyN Esvw== X-Received: by 10.181.13.166 with SMTP id ez6mr40419894wid.24.1442587763048; Fri, 18 Sep 2015 07:49:23 -0700 (PDT) Received: from [192.168.0.127] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id r4sm15931980wia.19.2015.09.18.07.49.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 07:49:22 -0700 (PDT) To: Bob Weinand References: <55FB4791.4040807@gmail.com> <55FB533F.7080301@gmail.com> <7726D162-4710-44BE-A1D0-44C2715D4160@gmail.com> Cc: PHP internals Message-ID: <55FC2438.7010701@gmail.com> Date: Fri, 18 Sep 2015 15:48:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------020007050503000406000600" Subject: Re: [PHP-DEV] Let's discuss enums! From: rowan.collins@gmail.com (Rowan Collins) --------------020007050503000406000600 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Bob Weinand wrote on 18/09/2015 15:23: > 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. Yeah, that was my instinct. It's a bit like surrogate keys on database tables - if your table has a natural Primary Key, there's no need to add an auto-increment field. :) And the name kind of has to exist anyway, or you can't reference the enum value at all. You could make it inaccessible, but then not being able to get a string representation for debugging, or to do a dynamic Weekdays::getByName($_GET['day']), would be annoying. Regards, -- Rowan Collins [IMSoP] --------------020007050503000406000600--