public static function fromString($string, $default=true)
    {
        $array = array();

        foreach (preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY) as $token) {
            $fragments = explode("=", $token);
            $value = isset($fragments[1])
                ? trim($fragments[1],"' ") : $default;

            $array[$fragments[0]] = $value === 'null'
                ? null : $value;
        }

        return new self($array, $default);
    }
public static function fromString($string, $default=true)
    {
        $array = array();

        foreach (preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY) as $token) {
            $fragments = explode("=", $token);
            $value = isset($fragments[1])
                ? trim($fragments[1],"' ") : $default;

            $array[$fragments[0]] = $value === 'null'
                ? null : $value;
        }

        return new self($array, $default);
    }
public static function fromString ( $ string , $ default = true ) { $ array = array ( ) ; foreach ( preg_split ( '/\s+/' , $ string , - 1 , PREG_SPLIT_NO_EMPTY ) as $ token ) { $ fragments = explode ( "=" , $ token ) ; $ value = isset ( $ fragments [ 1 ] ) ? trim ( $ fragments [ 1 ] , "' " ) : $ default ; $ array [ $ fragments [ 0 ] ] = $ value === 'null' ? null : $ value ; } return new self ( $ array , $ default ) ; }
Creates an options object from a flat string
@return Options
Creates an options object from a flat string