Re: [PATCH] [RFC] Closures and lambda functions in PHP
| From: | Stanislav Malyshev | 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 objectNot 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