Dictionary.php
public static function fromPairs($array)
    {
        if (!is_array($array) && !($array instanceof \Traversable)) {
            throw new \InvalidArgumentException(sprintf(
                'Dictionary::fromPairs() argument must be array or Traversable, '
                . 'but is "%s".', gettype($array)
            ));
        }
        
        $result = new Dictionary();
        foreach ($array as $pair) {
            if (!is_array($pair) || !isset($pair[0]) || !isset($pair[1])) {
                throw new \InvalidArgumentException(
                    'Each element of array or Traversable passed to Dictionary::FromPairs()'
                    . ' must be two-elements array.'
                );
            }
            
            $result[$pair[0]] = $pair[1];
        }
        return $result;
    }
public static function fromPairs($array)
    {
        if (!is_array($array) && !($array instanceof \Traversable)) {
            throw new \InvalidArgumentException(sprintf(
                'Dictionary::fromPairs() argument must be array or Traversable, '
                . 'but is "%s".', gettype($array)
            ));
        }
        
        $result = new Dictionary();
        foreach ($array as $pair) {
            if (!is_array($pair) || !isset($pair[0]) || !isset($pair[1])) {
                throw new \InvalidArgumentException(
                    'Each element of array or Traversable passed to Dictionary::FromPairs()'
                    . ' must be two-elements array.'
                );
            }
            
            $result[$pair[0]] = $pair[1];
        }
        return $result;
    }
public static function fromPairs ( $ array ) { if ( ! is_array ( $ array ) && ! ( $ array instanceof \ Traversable ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Dictionary::fromPairs() argument must be array or Traversable, ' . 'but is "%s".' , gettype ( $ array ) ) ) ; } $ result = new Dictionary ( ) ; foreach ( $ array as $ pair ) { if ( ! is_array ( $ pair ) || ! isset ( $ pair [ 0 ] ) || ! isset ( $ pair [ 1 ] ) ) { throw new \ InvalidArgumentException ( 'Each element of array or Traversable passed to Dictionary::FromPairs()' . ' must be two-elements array.' ) ; } $ result [ $ pair [ 0 ] ] = $ pair [ 1 ] ; } return $ result ; }
Create new Dictionary from array of key-value pairs.

@param   $array      array   Array of pairs. Each pair must be 2-element array.
@return  Dictionary
Create new Dictionary from array of key - value pairs .