Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38484 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50170 invoked from network); 20 Jun 2008 17:44:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2008 17:44:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:28623] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/67-12821-68CEB584 for ; Fri, 20 Jun 2008 13:44:39 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 20 Jun 2008 20:44:47 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 20 Jun 2008 10:44:24 -0700 Message-ID: <485BEC6A.1020209@zend.com> Date: Fri, 20 Jun 2008 10:44:10 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Larry Garfield CC: internals@lists.php.net References: <4856A547.3080801@gmx.net> <7E.CB.10717.56C7A584@pb1.pair.com> <485B5BCC.1060003@city.ee> <200806200729.40623.larry@garfieldtech.com> In-Reply-To: <200806200729.40623.larry@garfieldtech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Jun 2008 17:44:24.0106 (UTC) FILETIME=[471338A0:01C8D2FD] Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP From: stas@zend.com (Stanislav Malyshev) Hi! > As one of the Haskell list denizens commented, is there a potential for memory > leakage if lambdas implicitly import $this when defined within an object Not really leakage (if refcounts done right) but lifetimes extending beyond what is expected - i.e. if some instance of closure generated by the object is alive then the object is alive. If that's an issue, it can be improved by storing $this only for closures that actually use it (those messing with $$var will be in trouble). -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com