Re: How to dynamically call a constructor like call_user_func_array

From: Date: Thu, 27 Nov 2008 12:27:54 +0000
Subject: Re: How to dynamically call a constructor like call_user_func_array
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-51172@lists.php.net to get a copy of this message
Hello Jtaal, > I want to create a new instance of a class (which name I don't know) and > I want to expand a given array to be the constructor's parameters: > $clsname = 'mycls'; > $val = array('value1', 'value2'); > $obj = new mycls($val[0], $val[1]); // This line needs to be dynamic. call_user_func_array(). > Couldn't find on the php site how to do this. This is a theme for the php general mailing list. -- Regards/Mit freundlichen Grüßen Christian Weiske

« previous php.pear.dev (#51172) next »