Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

This is only part of a thread. view whole thread
February 12, 2020 21:40 (AllenJB)
On 12/02/2020 18:20, Niklas Keller wrote:
> Type Safety > > I think the API should be type safe. Currently $request->get['key'] > can be null | string | string[] | ... Most parameters only appear a > single time, so a method returning the first parameter value or null > could be used instead.
I may be misunderstanding what you're suggesting here, but it seems you're proposing to have ->get['key'] only return null|string, getting rid of the arrays of parameter values ( ?key[]=value1&key[]=value2 ) functionality here. (And I assume you intend the same for ->post['key'] ) If so, I would say this is a bad idea. I and a lot of other devs use this functionality frequently (more often in POST, but often enough in GET for purposes such as search pages). And how would multiple select inputs be handled? AllenJB