View Single Post
Old 05-03-2008, 08:50 PM   #9 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Rather than re-wiring all of your classes to accept a single argument in the form of an array, you could use PHP5's Reflection API to create a new object instance with our arguments like:
PHP Code:
// Equivalent of $object = new Object(...);
$reflect = new ReflectionClass('Object');
$object  $reflect->newInstanceArgs($args); 
Salathe is offline  
Reply With Quote