On Wednesday 16 May 2001 12:12, Hannes Schmiderer wrote:
> elias wrote:
> > good question...I might need an answer when you get one.
>
> Why?
> Ok, I have a perl-counter script which is included to shtml-pages with
> SSI. Now I want to add some PHP pages to my site. So I need a
> PHP-function that does the same as the perl-script does. In the script
> I have a lot of global variables and some auxiliary functions. In PHP
> these variables became local variables of the counter() function and
> the auxiliary functions became nested functions. The auxiliary nested
> functions have to have access to a lot of variables from the counter()
> function, and they even have to change them. I already added all the
> variables (some with call by reference) but I think it would have been
> easier if I had access the counter()-variables within the nested
> auxiliary functions direct.

What about using classes instead of outer functions? Classes provide 
rather nice (nestable) scoping.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Software is like sex: the best is for free" -- Linus Torvalds

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to