You are here: Re: can I use create_function to create enclosures? « PHP Programming Language « IT news, forums, messages
Re: can I use create_function to create enclosures?

Posted by lawrence k on 04/24/07 07:39

> > You misunderstood the question. I was asking "Does PHP support
> > closures?" That was the question. I like using closures in languages
> > such as Ruby and Javascript. I was wondering if there was any way to
> > do so in PHP. I'm assuming the answer is no.
>
> OK, I understand now.
>
> If you're talking about $this->value being used to define $value as a
> class member, no.
>
> You can do it for array elements, though -
>
> $myArray['value'] = 123;
>
> defines the array element with key 'value'.
>
> Personally I've never liked being able to define variables dynamically.
> It becomes very difficult to debug and/or modify the code.


Closures are the only way to create protected class variables in
Javascript. In Ruby they are essential for the use of blocks. I wish
PHP supported them so I could add methods to the classes that my co-
worker wrote, without having to use inheritance or to open and edit
their source code.

 

Navigation:

[Reply to this 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

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