Re: RFC: Server-Side Request and Response Objects (v2)

From: Date: Wed, 12 Feb 2020 21:40:57 +0000
Subject: Re: RFC: Server-Side Request and Response Objects (v2)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-108520@lists.php.net to get a copy of this message
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

« previous php.internals (#108520) next »