public function mergeOptions(array $options, $recursive = false, $reverse = false)
    {

        $merge = 'array_replace';

        if ($recursive)
            $merge .= '_recursive';

        $this->options = $reverse
            ? $merge($options, $this->options)
            : $merge($this->options, $options);

        return $this;
    }
public function mergeOptions(array $options, $recursive = false, $reverse = false)
    {

        $merge = 'array_replace';

        if ($recursive)
            $merge .= '_recursive';

        $this->options = $reverse
            ? $merge($options, $this->options)
            : $merge($this->options, $options);

        return $this;
    }
public function mergeOptions ( array $ options , $ recursive = false , $ reverse = false ) { $ merge = 'array_replace' ; if ( $ recursive ) $ merge .= '_recursive' ; $ this -> options = $ reverse ? $ merge ( $ options , $ this -> options ) : $ merge ( $ this -> options , $ options ) ; return $ this ; }
Merges the current options with another option array.

The second parameter makes this recursive.
The functions used are array_replace and array_replace_recursive

Passing the third parameter reverses the merge, so you don't overwrite
passed options with existing one, but rather set them only if they
don't exist yet (defaulting)

@param array $options    the options to merge with
@param bool  $recursive  should we merge recursively or not
@param bool  $reverse    should values be prepended rather than appended

@return $this
Merges the current options with another option array .