This code does not function as expected: // $field contains the name of a subclass of WMSInput. $fieldClone = clone $field;