Skip to content

Commit 29e1c0e

Browse files
jontjsjaviereguiluz
authored andcommitted
Update http_foundation.rst
`$request->query->all()['foo'];` triggers an 'Undefined array key "foo"' error when `foo` doesn't exist. However `$request->query->all('foo');` return null when `foo` doesn't exist (consistent with `$request->query->get('bar');` for accessing a string parameter `bar` which might not exist).
1 parent 1a82990 commit 29e1c0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ doesn't support returning arrays, so you need to use the following code::
169169
// the query string is '?foo[bar]=baz'
170170

171171
// don't use $request->query->get('foo'); use the following instead:
172-
$request->query->all()['foo'];
172+
$request->query->all('foo');
173173
// returns ['bar' => 'baz']
174174

175175
$request->query->get('foo[bar]');

0 commit comments

Comments
 (0)