Reply to Re: can I use create_function to create enclosures?

Your name:

Reply:


Posted by Andy Hassall on 04/16/07 19:33

On 15 Apr 2007 22:14:12 -0700, "lawrence k" <lkrubner@geocities.com> wrote:

>Just noticed this for the first time:
>
>http://us2.php.net/manual/en/function.create-function.php
>
>Anyone know if PHP supports enclosures, like Javascript or Ruby? I've
>always assumed PHP lacked these. If I create a function with object
>instances, will the instances retain their state if the function
>definition is stored in a variable?

No, PHP doesn't support closures; create_function is basically just a
restricted eval(). The function definition is a string, and isn't connected to
the scope from which create_function is called.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

[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

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