My reading of the RFC is that square brackets are not included in the
'query' rule. That was also suggested on Jun 02, 2007 in a reply to the
post above, but no reply was made to that.
I think it's unfortunate if square brackets can't be included un-encoded in
the query string according to the relevant spec, e.g. RFC 3986. If the
decision is made to deviate from the spec, that is what it is, but it seems
like this decision may have been made with an inaccurate understanding of
what the spec says. Or have I misunderstood something?
For what it's worth, http_build_query() encodes square brackets, and
parse_str() produces the same result with either encoded or unencoded square
brackets. See http://bugs.php.net/bug.php?id=36656