public function add($item)
    {
        if ($item instanceof Hashable) {
            $this->items[$item->hashCode()] = $item;

            return;
        }

        $this->items[(string)$item] = $item;
    }
public function add($item)
    {
        if ($item instanceof Hashable) {
            $this->items[$item->hashCode()] = $item;

            return;
        }

        $this->items[(string)$item] = $item;
    }
public function add ( $ item ) { if ( $ item instanceof Hashable ) { $ this -> items [ $ item -> hashCode ( ) ] = $ item ; return ; } $ this -> items [ ( string ) $ item ] = $ item ; }
Add a new item to the set.

Overrides values that were previously set that have the same value
or hashCode. If you pass an object make sure it implements either
{__toString()} or the {@see Hashable} interface.

@param mixed $item
@return void
Add a new item to the set .