I am in a situations where i need to instantiate a class with arguments from within an instance of another class. Here is the prototype:
//test.php class test {
you need Reflection http://php.net/manual/en/class.reflectionclass.php
if(count($args) == 0) $obj = new $className; else { $r = new ReflectionClass($className); $obj = $r->newInstanceArgs($args); }