Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57973 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25096 invoked from network); 23 Feb 2012 13:39:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2012 13:39:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=dsnytkine@Ultralogistics.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dsnytkine@Ultralogistics.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain Ultralogistics.com from 64.197.110.172 cause and error) X-PHP-List-Original-Sender: dsnytkine@Ultralogistics.com X-Host-Fingerprint: 64.197.110.172 thrud.alliantinternet.com Received: from [64.197.110.172] ([64.197.110.172:57501] helo=thrud.alliantinternet.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/60-14213-791464F4 for ; Thu, 23 Feb 2012 08:39:35 -0500 Received: by thrud.alliantinternet.com (Postfix, from userid 1001) id 458D0174322; Thu, 23 Feb 2012 08:39:32 -0500 (EST) To: "'Stas Malyshev'" Cc: "'Sebastian Krebs'" , "'PHP internals list'" References: <4F455C96.50706@gmail.com> <4F455E91.2060408@alliantinternet.com> <028001ccf1ab$0b200050$216000f0$@alliantinternet.com> <4F457517.7050901@alliantinternet.com> In-Reply-To: <4F457517.7050901@alliantinternet.com> Date: Thu, 23 Feb 2012 08:39:30 -0500 Message-ID: <028d01ccf230$91d79b00$b586d100$@alliantinternet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Thread-Index: AczxtrIG/jSRZTokRm6HD0p3UlyEuwAec7ww Content-Language: en-us Subject: RE: [PHP-DEV] [RFC] Enum proposal (yet another) From: dsnytkine@Ultralogistics.com ("Dmitri Snytkine") True but it will have with type hinting, making code more 'bullet proof' Dmitri Snytkine Web Developer Ultra Logistics, Inc. Phone: (888) 220-4640 x 2097 Fax: (888) 795-6642 E-Mail: dsnytkine@ultralogistics.com Web: www.ultralogistics.com "A Top 100 Logistics I.T. Provider in 2011" -----Original Message----- From: Stas Malyshev [mailto:smalyshev@sugarcrm.com] Sent: Wednesday, February 22, 2012 6:07 PM To: Dmitri Snytkine Cc: 'Sebastian Krebs'; 'PHP internals list' Subject: Re: [PHP-DEV] [RFC] Enum proposal (yet another) 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