Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83548 invoked from network); 23 Feb 2012 18:34:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2012 18:34:51 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.143 smtp143.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.143] ([207.97.245.143:44893] helo=smtp143.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/C0-61020-AC6864F4 for ; Thu, 23 Feb 2012 13:34:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp44.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 275D61284C8; Thu, 23 Feb 2012 13:34:48 -0500 (EST) X-Virus-Scanned: OK Received: by smtp44.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 74C01128639; Thu, 23 Feb 2012 13:34:47 -0500 (EST) Message-ID: <4F4686C6.2040207@sugarcrm.com> Date: Thu, 23 Feb 2012 10:34:46 -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: Anthony Ferrara CC: Dmitri Snytkine , Sebastian Krebs , PHP internals list References: <4F455C96.50706@gmail.com> <4F455E91.2060408@alliantinternet.com> <028001ccf1ab$0b200050$216000f0$@alliantinternet.com> <4F457517.7050901@alliantinternet.com> <028d01ccf230$91d79b00$b586d100$@alliantinternet.com> In-Reply-To: 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! > If you're going to go that far, why not make a flyweight enum type? > (Basically what's described here: http://c2.com/cgi/wiki?FlyweightEnum > )... > > Right now, it's a hack to get typing in place to let you pass an > integer where a class is defined (the public function foo(MyEnum > $enum) bit). If you used a flyweight, you could literally type-hint. Again, it looks like you are trying to introduce strict typing into PHP. I do not think it's a good idea, for the reasons I described at length in previous discussions, but you're free to try. However, I don't see how changing the language to make it easier to do partial backdoor strict typing is a good idea. Bringing Java as an example only supports this point. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227