phpversion()>=5.3 will compliant with RFC 3986, while phpversion()<=5.2.7RC1 is not compliant with RFC 3986.
History of related RFCs:
RFC 1738 section 2.2
only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used
unencoded within a URL.
RFC 2396 section 2.3
unreserved = alphanum | mark
mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
RFC 2732 section 3
(3) Add "[" and "]" to the set of 'reserved' characters:
RFC 3986 section 2.3
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
RFC 3987 section 2.2
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"