public function set($key, $value = null)
    {
        if (isset($value)) {
            return $this->array[$key] = $value;
        }

        return $this->array[] = $key;
    }
public function set($key, $value = null)
    {
        if (isset($value)) {
            return $this->array[$key] = $value;
        }

        return $this->array[] = $key;
    }
public function set ( $ key , $ value = null ) { if ( isset ( $ value ) ) { return $ this -> array [ $ key ] = $ value ; } return $ this -> array [ ] = $ key ; }
Adds an element to the array. With key or without.

@param int|string $key
@param mixed $value
@return void
Adds an element to the array . With key or without .