Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61541 invoked from network); 22 Feb 2012 23:07:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2012 23:07:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:57958] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/B1-46696-B15754F4 for ; Wed, 22 Feb 2012 18:07:08 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp25.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 3C3CB2D014B; Wed, 22 Feb 2012 18:07:04 -0500 (EST) X-Virus-Scanned: OK Received: by smtp25.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id DCBF62D0073; Wed, 22 Feb 2012 18:07:03 -0500 (EST) Message-ID: <4F457517.7050901@sugarcrm.com> Date: Wed, 22 Feb 2012 15:07:03 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 MIME-Version: 1.0 To: Dmitri Snytkine CC: 'Sebastian Krebs' , 'PHP internals list' References: <4F455C96.50706@gmail.com> <4F455E91.2060408@alliantinternet.com> <028001ccf1ab$0b200050$216000f0$@alliantinternet.com> In-Reply-To: <028001ccf1ab$0b200050$216000f0$@alliantinternet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Enum proposal (yet another) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > For those who keep saying "but this can already be done in php", here is a > pretty good article. > Long time ago enums were not available in Java also, so this article > explains that yes, thigs can technically could be done before the enum, and > why certain things are better with enums. > > http://javarevisited.blogspot.com/2011/08/enum-in-java-example-tutorial.html One note here: Java is a statically typed compiled language. PHP is not. So many arguments regarding type safety, etc. which are completely valid in regards to Java have no validity in regard to PHP. I understand that some people want to import some bits from strictly typed languages, imagining that this will provide them with benefits that statically typed languages have, namely compile-time safety checks, etc. This does not work as well in dynamic languages. Note for example that neither Ruby nor Python have enums, though you can do similar things there. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227