Sort variables before extracting data from uri.
We have to sort vars by non-explode to explode.

@param array $vars
@return array
12769
protected function sortVariables(array $vars)
    {
        usort($vars, function($a, $b) {
            return $a->options['modifier'] >= $b->options['modifier'] ? 1 : -1;
        });

        return $vars;
    }
25319
private function sortValues($values)
    {
        if (!($this->orderField && \is_array($this->{$this->orderField}))) {
            return $values;
        }
        /** @var array $orderValues */
        $orderValues = $this->{$this->orderField};
        $result      = [];
        foreach ($orderValues as $i) {
            if (isset($values[$i])) {
                $result[$i] = $values[$i];
                unset($values[$i]);
            }
        }
        if (!empty($values)) {
            foreach ($values as $k => $v) {
                $result[$k] = $v;
            }
        }
        return $result;
    }
278104
public static function order($items) {
		if (empty($items)) {
			return array();
		}

		$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
		asort($_items);

		foreach (array_keys($_items) as $key) {
			$_items[$key] = $items[$key];
		}

		return $items;
	}
381359
private function filterVariablesUsedAsPlaceholders($string, array $variables)
    {
        if (empty($string)) {
            return $variables;
        }

        // array_filter() is not used because ARRAY_FILTER_USE_KEY requires PHP 5.6
        $filteredVariables = array();
        foreach ($variables as $key => $value) {
            if (false === strpos($string, '{'.$key.'}')) {
                $filteredVariables[$key] = $value;
            }
        }

        return $filteredVariables;
    }
432635
public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));

        return $vars;
    }
832298
function sort_columns( $vars ) {

        // Cycle through all sortable columns submitted by the user
        foreach ( $this->sortable as $column => $values ) {

            // Retrieve the meta key from the user submitted array of sortable columns
            $meta_key = $values[0];

            // If the meta_key is a taxonomy
            if( taxonomy_exists( $meta_key ) ) {

                // Sort by taxonomy.
                $key = "taxonomy";

            } else {

                // else by meta key.
                $key = "meta_key";
            }

            // If the optional parameter is set and is set to true
            if ( isset( $values[1] ) && true === $values[1] ) {

                // Vaules needed to be ordered by integer value
                $orderby = 'meta_value_num';

            } else {

                // Values are to be order by string value
                $orderby = 'meta_value';
            }

            // Check if we're viewing this post type
            if ( isset( $vars['post_type'] ) && $this->post_type_name == $vars['post_type'] ) {

                // find the meta key we want to order posts by
                if ( isset( $vars['orderby'] ) && $meta_key == $vars['orderby'] ) {

                    // Merge the query vars with our custom variables
                    $vars = array_merge(
                        $vars,
                        array(
                            'meta_key' => $meta_key,
                            'orderby' => $orderby
                        )
                    );
                }
            }
        }
        return $vars;
    }
13798
public function add_query_vars( $vars = array() ) {
		if ( ! empty( $this->rewrite_endpoint ) ) {
			$keys = array_keys( $this->rewrite_endpoint );
			return array_merge( $vars, $keys );
		}
		return $vars;
	}
245367
public function parse($string, array $vars = [])
    {
        $output = $string;

        if(is_file($string)) {
            $output = file_get_contents($string);
        }

        if($this->count()) {
            foreach($this->registry as $adapter) {
                if($adapter instanceof Abstracts\AbstractAdapter) {
                    if($adapter->isSupported()) {
                        $adapter->initialize();
                        $adapter->loadString($output);
                        $output = $adapter->parse($vars);
                    }
                }
            }
        }

        return $output;
    }
636460
protected function _updateEnvVars(array $vars) {
        return f\reduce_assoc(
            function ($o, $var, $key) {
                // Store the current value
                $o[$key] = getenv($key);
                // Put the new value
                putenv("{$key}={$var}");
                return $o;
            },
            array(),
            $vars
        );
    }
866375
public function translateVars($text, $vars = array())
    {
        return strtr($text, array_merge($this->getParentVars(), $this->getVars(), $vars));
    }
971277
protected function extractUrlVariables($url){
        $variables = array();
        $pattern = "/(\\".static::$_URL_VAR_CHARACTER.".*?[^\\/]*)/";
        if (preg_match($pattern,$url,$matches)){
            array_shift($matches);
            foreach($matches as $match){
                $variables[] = $match[0];
            }
        }
        return $variables;
    }
800034
public function parse(array $vars = [])
    {
        $this->engine->parse($this->string);

        return $this->engine->getAsHtml();
    }
1016508
public static function MakeHashString($variables) {
        $toHash = "";
        $ucfirst = true;
        if (isset($variables["col"]) && isset($variables["op"])) {
            $ucfirst = false;
        }
        foreach ($variables as $k => $v) {
            if ($v === null) continue;
            if ($v === "") continue;
            if ($v === false) $v = "0";
            if ($k === "CRC") continue;
            if ($v === "__AW__VALUE_NOT_CHANGED") continue;
            if ($ucfirst) $k = ucfirst($k);
            if (is_array($v)) {
                if (!count($v)) continue;
                $str = Client::MakeHashString($v);
                if ($str) {
                    $toHash.= $k . "=" . $str . "&";
                }
            } else {
                $toHash.= $k . "=" . $v . "&";
            }
        }
        return $toHash = rtrim($toHash, "&");
    }
359266
public static function dropVars($string, $vars = [])
    {
        return strtr($string, array_flip(array_map(function ($v) {
            return ':' . $v;
        }, array_flip($vars))));
    }
982810
protected function sort(array $parameters)
    {
        uksort(
            $parameters,
            function ($key1, $key2) {
                return strtolower($key1) > strtolower($key2) ? 1 : -1;
            }
        );

        return $parameters;
    }
1079956
public static function setVariables(array $vars)
    {
        foreach ($vars as $varName => $varValue) {
            if ($varName === 'env') {
                continue;
            }
            $GLOBALS[$varName] = $varValue;
        }
        if (array_key_exists('env', $vars)) {
            static::$env = $vars['env'];
        }
    }
1071545
protected function extractVariables($variablesFile)
    {
        $str   = file_get_contents($variablesFile);
        $parts = explode(';', preg_replace('/(\/\/.*?\n|\s\n|\s{2,})/', '', $str));
        $vars  = array();

        foreach ($parts as $part) {
            $varMeta = explode(':', $part);
            if (empty($varMeta[0]) || empty($varMeta[1])) {
                continue;
            }
            $vars[substr(trim($varMeta[0]), 1)] = trim($varMeta[1]);
        }

        return $vars;
    }