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

From: Date: Thu, 26 Jun 2008 08:06:19 +0000
Subject: Re: [PATCH] [RFC] Closures and lambda functions in PHP
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-38628@lists.php.net to get a copy of this message
On 18.06.2008, at 14:17, Christian Seiler wrote:
Now, upon execution of the code containing the closure, the new opcode just copies the zend_function structure into a copy, registers that copy as a resource and returns that resource. As soon as the resource is garbage collected (or explicitly unset), the op_array copy is destroyed. No modification of the actual class is done at all - the cache remains happy.
So since a reference is stored, it means that the destructor of the enclosing object is only called once not only the variable holding the object, but also all lambda functions that were created inside of the class have been free'ed? regards, Lukas Kahwe Smith mls@pooteeweet.org

« previous php.internals (#38628) next »