src/Core/Rest.php
private function matchProcess(array $routers, & $process_closure, & $params)
    {
        uasort($routers, function ($a, $b) {
            return $a['params_count'] < $b['params_count'];
        });

        foreach ($routers as $router => $router_config) {
            $params = array();
            if (true === $this->matchCustomRouter($router, $router_config['params_key'], $params)) {
                $process_closure = $router_config['process_closure'];
                return true;
            }
        }

        return false;
    }
private function matchProcess(array $routers, & $process_closure, & $params)
    {
        uasort($routers, function ($a, $b) {
            return $a['params_count'] < $b['params_count'];
        });

        foreach ($routers as $router => $router_config) {
            $params = array();
            if (true === $this->matchCustomRouter($router, $router_config['params_key'], $params)) {
                $process_closure = $router_config['process_closure'];
                return true;
            }
        }

        return false;
    }
循环匹配(参数多的优先)

@param array $routers
@param $process_closure
@param array $params
@return bool