src/WorkerF/Http/Route.php
protected static function _variablePathParse($path, $method)
    {
        // Why use array_reverse? Because if route is renamed, we want to use the last one
        $variable_paths = array_keys(array_reverse(self::$_variable_map_tree));
        
        $path_info = [];
        // variable route matched or not
        foreach ($variable_paths as $variable_path) {
            
            preg_match($variable_path, $path, $matched);

            if ( ! empty($matched)) {
                // get params    
                array_shift($matched);
                $path_info['params'] = $matched;
                // save variable path
                $path_info['callback'] = self::$_variable_map_tree[$variable_path][$method];
                // save middleware symbols
                $path_info['middleware'] = self::$_middleware_map_tree[$variable_path][$method];
                // stop find
                break;
            }
        }
    
        return empty($matched) ? NULL : $path_info;
    }
protected static function _variablePathParse($path, $method)
    {
        // Why use array_reverse? Because if route is renamed, we want to use the last one
        $variable_paths = array_keys(array_reverse(self::$_variable_map_tree));
        
        $path_info = [];
        // variable route matched or not
        foreach ($variable_paths as $variable_path) {
            
            preg_match($variable_path, $path, $matched);

            if ( ! empty($matched)) {
                // get params    
                array_shift($matched);
                $path_info['params'] = $matched;
                // save variable path
                $path_info['callback'] = self::$_variable_map_tree[$variable_path][$method];
                // save middleware symbols
                $path_info['middleware'] = self::$_middleware_map_tree[$variable_path][$method];
                // stop find
                break;
            }
        }
    
        return empty($matched) ? NULL : $path_info;
    }
Parse variable route info (like params, route callback).

@param  string  $path
@param  string  $method
@return mixed string or NULL