Daniel Lowrey wrote (on 02/10/2013):
Something like the following would be an infinitely superior solution:

interface HttpRequest {

While having a quick look for userland parsing functions earlier, I came upon the PECL http extension, which includes this all-singing object:

http://www.php.net/manual/en/class.httprequest.php

As for this:

You can't efficiently model an HTTP request with associative arrays. Period.

The fact is that for 99% of use cases, yes you can, and developers happily do so. PHP even allows the convenient field_name[]= and field_name[key]= notations for building multi-dimensional arrays.

This is all a convenience wrapper, and a consistent low-level API would be good, but alternative high-level APIs can be built from a few fundamental building blocks (e.g. getting the basic raw request parts as strings, parsing strings in various form encodings) without building a whole HTTP framework into the core.

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to