Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52862 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18679 invoked from network); 3 Jun 2011 12:27:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2011 12:27:33 -0000 Authentication-Results: pb1.pair.com header.from=dhaarbrink@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=dhaarbrink@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: dhaarbrink@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:37961] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/B7-08509-433D8ED4 for ; Fri, 03 Jun 2011 08:27:32 -0400 Received: by vxb40 with SMTP id 40so1494675vxb.29 for ; Fri, 03 Jun 2011 05:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5181eW4XypSqXmywuVuwt5x7bHZK5Hkr2HLYpjRy4dw=; b=JXHIAJUGVLVJk7yrOqBR5tnEIfMtvFpvdl5seJAoOM4f6u7ztwP1DJ76G/vYk/YZR2 2I360eSeIBGuNlu71Js5MH5e6ys4qs8fWqbPVw05RpLcmNWVMy5v+sGR61CHfXxBiQaf oC0Nti92pV1UW8VqLFXQD2smarEcJOCnh4lj0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=qU5+3W1H19wiISR6aYtLmNqB40LPJPBYGRwqBgwErAsSKmGnGX9LqhmVccf/q2n9p1 CPDcDhE/XemtpQvT7rL6uxXC0NJ1Oe9m3mpF60myZRl3Jq5MemIVwURCDE07svIWmLx5 aqe7ncTJzEwzCT7NYYTpBBk3kQCmXIj5Xet9k= Received: by 10.52.74.74 with SMTP id r10mr2473404vdv.212.1307104049390; Fri, 03 Jun 2011 05:27:29 -0700 (PDT) Received: from mail-vw0-f42.google.com (mail-vw0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id t13sm18573vds.42.2011.06.03.05.27.28 (version=SSLv3 cipher=OTHER); Fri, 03 Jun 2011 05:27:29 -0700 (PDT) Received: by vwl1 with SMTP id 1so1511537vwl.29 for ; Fri, 03 Jun 2011 05:27:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.172.213 with SMTP id m21mr624941vcz.210.1307104048492; Fri, 03 Jun 2011 05:27:28 -0700 (PDT) Received: by 10.220.164.136 with HTTP; Fri, 3 Jun 2011 05:27:28 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Jun 2011 14:27:28 +0200 Message-ID: To: Pierrick Charron Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e68972307eb0e604a4cde0a1 Subject: Re: [PHP-DEV] RFC: Enum From: dhaarbrink@gmail.com (Dennis Haarbrink) --0016e68972307eb0e604a4cde0a1 Content-Type: text/plain; charset=ISO-8859-1 As soon as I have my requested write permission in the rfc namespace i will update it. -- Dennis Haarbrink 2011/6/3 Pierrick Charron > 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 >> > > --0016e68972307eb0e604a4cde0a1--