I have a complete Form Creation System. There are many different Question Types and I have to check if the answer which the person had made is correct.
All types of Questions has its own class will is always called ItemClass and this Class is in its own File.
Everytime a Question is asked I include the File and there is the problem: I have to check different types of Questions in one PHP-File. And then there comes the error - ItemClass already declared.
Is there any method to unset a Class?
I tested your solutions and finally I got an Idea: I renamed the Classes to each of it's type (ynItemClass, markItemClass, ...) and when I need a Item Type a made the following
$it = $item->item_type."ItemClass";
$test = new $it($smarty);
And it works!!
Have a nice Day! Dominik