/** * Initializes the set using the given elements. * * In case element type is set, it is not possible to add an object of * another type to the set. * * @param null|string $elementType Type of the elements of the set * @param array $elements Initial elements of the set */ public function __construct(string $elementType = null, array $elements = array()) { // set element type $this->elementType = $elementType; // init set with given elements parent::__construct($elements); }