You are here: Re: Analog of call_user_func_array for class creation. « PHP Programming Language « IT news, forums, messages
Re: Analog of call_user_func_array for class creation.

Posted by David Haynes on 11/17/58 11:50

AlexVN wrote:
> Henk,
>
> Thank you for the great answer. You are right--I'm looking for a method
> of instantiating class with dynamic parameters, not creating. I
> understant the method you proposed, but what I would much rather see is
> a method of calling class constructor with dynamic number of
> parameters. I suspect that PHP does not have such method (since you, a
> guru, do not listed it here) and will try to create a couple of ifs for
> my case.
>
> Thanks,
> Alexander
> http://www.alexatnet.com/

I know its not quite what you had in mind (i.e. polymorphism) but I have
had some success with passing an associative array to a class
constructor and then letting the constructor figure out what to do. This
is a bit different from the $foo = null type of setup since you may
supply any number of keys in the associative array but undefined keys
have no value.

-david-

 

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

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