Re: [PATCH] [RFC] Closures and lambda functions in PHP

From: Date: Fri, 20 Jun 2008 17:44:10 +0000
Subject: Re: [PATCH] [RFC] Closures and lambda functions in PHP
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-38484@lists.php.net to get a copy of this message
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

« previous php.internals (#38484) next »