I have a base class called field and classes that extend this class such as text, select, radio, checkbox, <
field
text
select
radio
checkbox
This should be enough:
$field_type = 'checkbox'; $field = new $field_type();
Code I tested it with in PHP 5.3
$c = 'stdClass'; $a = new $c(); var_dump($a); >> object(stdClass)#1 (0) { }