Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52834 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33722 invoked from network); 3 Jun 2011 07:26:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2011 07:26:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=dhaarbrink@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dhaarbrink@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.42 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.210.42 mail-pz0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:41641] helo=mail-pz0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/60-29906-AAC88ED4 for ; Fri, 03 Jun 2011 03:26:34 -0400 Received: by pzk37 with SMTP id 37so805434pzk.29 for ; Fri, 03 Jun 2011 00:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=pBY4tyZIoofkjXU5kCsjvZZthaOPaRiLdmEomVo75m8=; b=VwIr/CbeqYCPltj/61+KpxSujJTMb2fGFepTaiTEykEAsTtzKankX/oV6T6rh2lXVT XLMbB5k2ZAXYausRp+i0HN1mwPbp8SL3sh86J0Tf0GSTIy/lS3J/7n8teIKHARCInEVh RDTG3g6DYgrSWhz3xZ7Lg7aAczFaSlVjwksak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=XgTiQ/xZDYCFKIZW9KejQ4ITnocZXMNRTm9KIHSx0v99Yt1u9wSmdjmdyakBStAVtG TRtjiWf7ppUF7RLdBHb/Hd0hvzgFxD8JZAbL8pxAkworaMWwb9NpOGWLeXYMqAlo32it L2r4RkemV4eFNgRshFHX1K2j7De2iv0Jy9VBA= Received: by 10.68.21.194 with SMTP id x2mr643194pbe.190.1307085990810; Fri, 03 Jun 2011 00:26:30 -0700 (PDT) Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id y2sm1252083pbg.40.2011.06.03.00.26.29 (version=SSLv3 cipher=OTHER); Fri, 03 Jun 2011 00:26:29 -0700 (PDT) Received: by pwj3 with SMTP id 3so927714pwj.29 for ; Fri, 03 Jun 2011 00:26:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.39.4 with SMTP id l4mr640340pbk.143.1307085988816; Fri, 03 Jun 2011 00:26:28 -0700 (PDT) Received: by 10.68.56.168 with HTTP; Fri, 3 Jun 2011 00:26:28 -0700 (PDT) Date: Fri, 3 Jun 2011 09:26:28 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec520ebbd0de6e304a4c9acb5 Subject: RFC: Enum From: dhaarbrink@gmail.com (Dennis Haarbrink) --bcaec520ebbd0de6e304a4c9acb5 Content-Type: text/plain; charset=ISO-8859-1 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 --bcaec520ebbd0de6e304a4c9acb5--