Posted by Chung Leong on 09/28/67 11:37
Andy Hassall wrote:
> On 16 Jan 2006 17:40:31 -0800, "Chung Leong" <chernyshevsky@hotmail.com> wrote:
>
> >What you're trying to do is create a closure, which can't be done in
> >PHP as far as I know.
>
> create_function() gets close to this.
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
There is no good way to bind a reference to the function though, aside
from (a) a variable global (b) a wrapper class plus the array($obj,
'function') construct. PHP evidently doesn't allow lambda functions to
have static variable, so you can't give a function a private variable.
[Back to original message]
|