request 是对象 还是数组? 为什么 都可以调用 附代码

我一直认为request 是个数组 为什么 用对象也可以调用 求解

public function search(Request $request)

    {
        echo $request['a_sqbh'];
        echo '<br>';
        echo $request->a_sqbh;
        dd($request);

结果如下 :

6
6
Request {#40 ▼
  #json: null
  #convertedFiles: []
  #userResolver: Closure {#130 ▶}
  #routeResolver: Closure {#137 ▶}
  +attributes: ParameterBag {#42 ▶}
  +request: ParameterBag {#41 ▼
    #parameters: array:3 [▼
      "_token" => "eOB8C195rAvdsLUDByPy7vacnM1c2HJgHFFUzsRw"
      "c_cqbh" => "10"
      "a_sqbh" => "6"
    ]
  }
  +query: ParameterBag {#48 ▶}
  +server: ServerBag {#44 ▶}
  +files: FileBag {#45 ▶}
  +cookies: ParameterBag {#43 ▶}
  +headers: HeaderBag {#46 ▶}
  #content: null
  #languages: null
  #charsets: null
  #encodings: null
  #acceptableContentTypes: null
  #pathInfo: "/item/search"
  #requestUri: "/item/search"
  #baseUrl: ""
  #basePath: null
  #method: "POST"
  #format: null
  #session: Store {#158 ▶}
  #locale: null
  #defaultLocale: "en"
}
litaoweb
修改的评论也不能少于六个字哦!