Class definitions in PHP are still fairly infant. There is no way to do data hiding that I know of yet, eg private public values, which is unfortunate seeing as that would be imperitive in programming a dynamic development environment (security).
But much like any other programming language after you instantiate objects of that class your are stuck with the class definition for the object upon its initialization. The advantage of PHP though, is that it is not a compiled language, it is interpretted. This means that you can pretty do anything that you want as long as it follows a linear pattern.
For your problem I'm not sure exactly what you are looking for. The way you formulate your question it seems like you want to have this object extend the class that you are loading. This is something that sounds very interesting, as inheriting properties from different classes dynamically may be an interesting way to handle some issues.
What I believe you wanted to do though is have an object instantiate a class dynamically. This can be done a couple of ways.
Let's say I have an ObjectContainer class and a 100 different classes which extend a standard object, that is they have inhereted the same parent. Each has a unique name and the one that we want to use is provided to us at runtime in the variable $Class. It's parameters are stored in Params as a comma delimeted list as usual.
class ObjectContainer {
var $Object;
function ObjectContainer ($Class,$Params="") {
if(!class_exists($Class)include_once($Class.".php"); //This assumes that the class is in a file of the same name
if($Params)
$this->Object= eval (return new $Class($Params));
else // We don't need to waste an eval statement
$this->Object=new $Class;
}
}
Although this example doesn't actually do anything, it shows two things. It helps us see that we should always seperate our classes into seperate files if we don't want all of them loaded into memory at once and wish to dynamically load them as needed.
It also shows us that we can dynamically create new objects from a generalized variable which contains the classname and optionally a parameter list.
I hope this helps a little bit!
PS. If anyone knows how to implement data hiding in PHP I would be indebted to them