Reply to Re: Defining a callback Func for preg_replace_callback(), within some class's method

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация