3 ms·
- $_SERVER contains server and execution environment info - $_REQUEST contains request input parameter values (regardless of http verb) That's it. It's not a l
by fraktl 7y ago
- $_SERVER contains server and execution environment info
- $_REQUEST contains request input parameter values (regardless of http verb)
That's it. It's not a lot. They're 2 super simple arrays.
PHP can also work from command line where $_REQUEST/$_POST/$_GET are unavailable. You can also entirely ignore the existence of the above variables. You can read from standard input and treat input as JSON - options are endless. This merely means that the example shown is not entirely correct - it's not "how it works in PHP". It's merely one of the ways. But the real problem is: no one bothered to research it and you blindly assumed that's how it works.
Laravel (Http/Kernel library) standardized the interface towards the dev and that's great. But the input itself isn't as tied to PHP core as your comment makes it seem.