Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63380 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9949 invoked from network); 12 Oct 2012 21:01:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Oct 2012 21:01:08 -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.173 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.173 smtp173.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.173] ([207.97.245.173:36839] helo=smtp173.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/83-06472-21588705 for ; Fri, 12 Oct 2012 17:01:06 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp37.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 126983B039C; Fri, 12 Oct 2012 17:01:04 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp37.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 7F9693B039F; Fri, 12 Oct 2012 17:01:03 -0400 (EDT) Message-ID: <5078850D.7090702@sugarcrm.com> Date: Sat, 13 Oct 2012 00:01:01 +0300 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Christian Kaps CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Closures and type hinting From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Now if you pass a closure to the scan method which doesn't follow the > signature of the __invoke method, the engine should throw an error. > > What do you think? You are trying to take typing way beyond what PHP (or probably any mainstream dynamic language that exists now) provides. There are languages which provide static type systems capable of doing such things, but PHP isn't one of them and I don't think it should be. PHP has no static type control, and IMHO doing type safety validation at runtime does not seem to be a good proposition for PHP. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227