Possible Duplicate:
Is there a call_user_func() equivalent to create a new class instance?
I instansiate my class like this:
$className = 'varClassName';
$validator = new $className;
But I want to pass an array as an argument to the class constructor. I thought the following might work:
$className = 'varClassName(array('min'=>2, 'max'=50))';
$validator = new $className;
However this results in an error that the class cannot be found. So how can I pass args to a class constructor while using variable class name?