Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71355 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40561 invoked from network); 20 Jan 2014 21:11:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2014 21:11:06 -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 108.166.43.115 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.115 smtp115.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.115] ([108.166.43.115:40996] helo=smtp115.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/5B-02192-9E09DD25 for ; Mon, 20 Jan 2014 16:11:05 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp7.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id F22141B80B0; Mon, 20 Jan 2014 16:11:02 -0500 (EST) X-Virus-Scanned: OK Received: by smtp7.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 933401B80BF; Mon, 20 Jan 2014 16:11:02 -0500 (EST) Message-ID: <52DD90E5.2030205@sugarcrm.com> Date: Mon, 20 Jan 2014 13:11:01 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Philip Sturgeon CC: "internals@lists.php.net" References: <52D71748.1090402@googlemail.com> <52D71FAE.8030002@ajf.me> <005001cf124f$3a40df00$aec29d00$@tutteli.ch> <20140116110127.202079vzjsj76n7b@webmail.tutteli.ch> <0B.B1.24763.139B7D25@pb1.pair.com> <002001cf12da$2bfbda90$83f38fb0$@tutteli.ch> <52DCA3E7.80602@lerdorf.com> <52DCED71.3020207@pthreads.org> <006301cf15f5$22f8df60$68ea9e20$@tutteli.ch> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > This RFC optionally allows developers to say: > > 3. "Give me a bag of spanners, and break if they put anything else in there." > Note that neither generics nor array strict typing gives you that. Neither of them can control what is being put into the bag. The only thing you can do is to look in the bag and reject what has been put there post-factum (actually, with generics you can't do even that - generics parametrize you types, but you still have to have the typechecks somewhere, so from type checking point generics change nothing) - i.e. the check happens not when something is put in the bag but when you get the bag and you have to examine that bag (every single time you touch it) and pull out each element of it and ensure it is still a spanner. If you put the bag down, next time you touch it you have to pull out every single thing out of the bag and check if it is a spanner *again*. Is it really the bag you want to deal with? I wouldn't really want to own such bag, I'm not OCD enough for that :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227