Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16053 invoked from network); 3 Jun 2011 12:12:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2011 12:12:30 -0000 Authentication-Results: pb1.pair.com header.from=pierrick@webstart.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pierrick@webstart.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain webstart.fr from 209.85.212.173 cause and error) X-PHP-List-Original-Sender: pierrick@webstart.fr X-Host-Fingerprint: 209.85.212.173 mail-px0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:63076] helo=mail-px0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/47-08509-BAFC8ED4 for ; Fri, 03 Jun 2011 08:12:28 -0400 Received: by pxi16 with SMTP id 16so1061830pxi.18 for ; Fri, 03 Jun 2011 05:12:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.22.197 with SMTP id g5mr776485pbf.254.1307103144763; Fri, 03 Jun 2011 05:12:24 -0700 (PDT) Received: by 10.68.47.137 with HTTP; Fri, 3 Jun 2011 05:12:24 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Jun 2011 08:12:24 -0400 Message-ID: To: Dennis Haarbrink Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec5215a4da0dfba04a4cdaadd Subject: Re: [PHP-DEV] RFC: Enum From: pierrick@webstart.fr (Pierrick Charron) --bcaec5215a4da0dfba04a4cdaadd Content-Type: text/plain; charset=ISO-8859-1 Hi, The RFC was supposed to be a draft (i didn't really added it in the good section) and was written more to introduce the idea and make people think about it. Feel free to update it with any idea, concern you may have. Pierrick On 3 June 2011 03:26, Dennis Haarbrink wrote: > One thing I would really like to see in 5.4 is enums. > There is already an RFC for that: https://wiki.php.net/rfc/enum > > This was discussed in february this year, but no consensus was reached. > IIRC, the most notable problems were: > - What is the 'value' of enum constant: string or int, user defined scalar, > defaults > - Ability to make enums more 'class like', some people wanted to be able to > add methods. > > Another thing which was discussed (and I think most people agreed on that), > but is not in the RFC: type hinting in method signatures. > > > I think we should keep this simple proposal simple, let it be an enum in > all > its simplicity. > The toughest part would be to decide what would be the default value. Some > proposed to use the name of the constant, which is imho best for > debuggability (i like this one the best), or an auto incrementing int, > saying that it is better performance wise and which is more analog with > mysql's enum type. > > > So, to sum up: > - Do we really need enum level methods? > - Need to reach consensus on default values (strings vs auto inc. ints) > - RFC needs to be updated, explaining the type hinting of enums in method > signatures > > > > Regards, > Dennis Haarbrink > --bcaec5215a4da0dfba04a4cdaadd--