instantiating class question..
Posted: Thu Aug 16, 2007 6:28 pm
So I'm basically trying to create a CRUD class, that, when passed the class name, can figure out the basic CRUD operations on it's own using get_class_vars as well as some other means. However, I cannot figure out how to instantiate a class if you have a variable that holds the class name. I know I could use the eval function, but I'm worried about performance if I do that. Was hoping there was something along the lines of $data = new class($dataClass); that was fairly efficient.
I'm using the latest version of php 4 (yeah....don't ask...want five, but due to circumstances out of my control it ain't gonna happen).
I'm using the latest version of php 4 (yeah....don't ask...want five, but due to circumstances out of my control it ain't gonna happen).