hi,

have look at the overloadind of php.

You can define a "magic" __call function, with than gets called in case you call a member function which does not exist.
(How to use __call exactly depends on your php version)

Within these function you could then execute code.

Well, to inject a variable, you could also use the magic __set and __get functions but you can also simply do somehting like $this->bla = "bla";
You just have to change your include to
Code:
$this->name = 'Class Name 2';
no function... as this opens a new scope and $this is not known there.

Well, or.. you use the traditional approach of extending classes and instanciate the class you want...

hope i could point the direction