You are here: Re: Dynamically load functions « PHP Programming Language « IT news, forums, messages
Re: Dynamically load functions

Posted by Richard Levasseur on 10/03/70 11:51

Bob Stearns wrote:
> Thank you. This something along the lines I was thinking. I still have
> to change every function invocation, but only minimally, and if I must
> then I must.
>
> However I have some questions. I am an ancient dinosaur (retired after
> more than 40 years of programming and related activities) and have not
> played with the OOP features of PHP.
>
> 1 where is the (privileged, I would think, starting with '__') function
> '__autoload' referenced?
>

Its a built in PHP function. www.php.net/__autoload

> 2 $includeMap should contain 1 entry for each function I wish to
> reference, right? Why is it not private instead of public?
>

You could make it private, if you wanted. Doesn't really matter.

> 3 Is the function '__call' an override of a virtual function which is
> used to do the actual calling of functions in objects, after converting
> the argument list to an array (merging default parameters? )?
>

__call is automatically invoked when you overload() and object, see
www.php.net/overload

> 4 Is the function 'call_user_func_array' the actual system function
> calling routine?
>

Yes.

> 5 A matter of curiosity: are the system built in function arranged in
> classes that should be over ridden like this for purposes of
> instrumentation or further argument validation?
>

Huh? Not sure what you mean. Do you mean the built in php functions?
I don't think they are part of any pre-existing class. Some things are
language constructs (echo, unset, etc) and can't be called with
call_user_func_array.

As for argument validation...all it does is pass them to the function,
if its missing arguments or has arguments of the wrong type, it'll give
an error/warning like it normally would.

It should be noted that there are a few limitations due to __call and
call_user_func, namely you can't return things by reference. You may
be able to overcome this limitatin by wrapping the returned reference
inside an array, though.

 

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

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