public function __construct(array $attributes = [], $config = []) { $names = []; foreach ($attributes as $name => $value) { if (is_integer($name)) { $this->_attributes[$value] = null; $names[] = $value; } else { $this->_attributes[$name] = $value; $names[] = $name; } } $this->_names = array_keys(array_flip($names)); parent::__construct($config); }