Why using symfony $request->guery->all() instead of $_GET?

When using symphony’s HttpFoundation standalone outside framework, why using $request->guery->all() to get $_GET values, rather than just simply use $_GET itself since this Request component does not escape/clean $_GET values automatically? what is advantage of using $request->guery->all() vs $_GET? or $request->request->all() vs $_POST?

There isn’t a difference, as the documentation clearly points out.

I would assume the advantage is you can better manipulate the data (like filter it), when you need to and not when the framework thinks you should. That isn’t a job of the framework. It also allows you to simulate requests, which helps in testing.

Scott

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.