On 29 July 2017 21:22:30 BST, Stanislav Malyshev <smalys...@gmail.com> wrote: >> On a slight tangent, I consider $_SERVER to be a broken pile of >> "we'll just shove this in here and hope for the best", and I will >> oppose any attempt to convert it into an object which doesn't >> reorganize its keys to be sane, documented, and as cross-platform as >> the SAPI layer can make it. :P > >You cannot make it cross-platform, as it is specifically made for >environment consisting the current platform, making it cross-platform >would just force you to create yet another one which contains the bits >that didn't fit into "cross-platform".
I'm fine with having an interface for access to low-level, platform specific details, but that's not how I have mostly seen $_SERVER being used. Mostly, people want specific details, like the requested URL and the HTTP headers sent, all of which should be trivial for SAPIs to provide in a standard, user-friendly format. I wouldn't be surprised if some SAPIs are carefully mangling the data into fake CGI format, only for userland code to unmangle it for actual use. My point was that if we were considering a compatibility break anyway, we should look at separating out those common use cases into something higher level. Having done that, we could even allow the low-level "raw server vars" (not under the name $_SERVER) to drift even further apart, rather than sticking to CGI rules from 20+ years ago. Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php