Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59884 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13079 invoked from network); 13 Apr 2012 15:49:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2012 15:49:57 -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 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:41067] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/8E-35770-42B488F4 for ; Fri, 13 Apr 2012 11:49:56 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id D77633A0575; Fri, 13 Apr 2012 11:49:51 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp4.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 2B2343A0588; Fri, 13 Apr 2012 11:49:50 -0400 (EDT) Message-ID: <4F884B1E.1050009@sugarcrm.com> Date: Fri, 13 Apr 2012 08:49:50 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Verbitsky Alexander CC: "internals@lists.php.net" References: <4F87DF77.7040608@mail.by> <4F87E595.2090704@sugarcrm.com> <4F87F890.2000501@mail.by> In-Reply-To: <4F87F890.2000501@mail.by> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I am not sure but it is too expensive only for memory. I don't think > that current scope will be very big and operation for copying it very That depends on the scope, it can be very big - e.g. global scope. But more important is not that it is big by itself, but that it retains variables that are otherwise to be freed and thus increases overall memory usage. > we don't to know what variables will be needed in future. And seems to > me that can to detect which variables bound in closure and copy only it. If you know any way to do it, please tell. Please account for $$var, etc. > Many people use PHP not because it very fast and because it very simple > to use. Syntax must be more clear for support. And using additional > keyword for a bound with variables it's not doing it. I don't think it's very complex syntax - you just specify the variables. It takes 1 minute to read the manual and you know how to do it forever. It's not the rocket science to write use($a, $b). > At now this is there should not alter of course. What really needed is > 'named parameters' That's entirely different topic. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227