Re: [RFC] mysqli bind in execute

From: Date: Thu, 25 Feb 2021 08:35:56 +0000
Subject: Re: [RFC] mysqli bind in execute
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-113254@lists.php.net to get a copy of this message

> Le 11 févr. 2021 à 20:43, Kamil Tekiela <tekiela246@gmail.com> a écrit :
> 
> Hi internals,
> 
> I am proposing the next change to improve mysqli extension. This RFC's goal
> is to add a new optional parameter to mysqli_stmt:execute() that will take
> an array of parameters.
> 
> The RFC is located at https://wiki.php.net/rfc/mysqli_bind_in_execute
> 
> I'd be happy to hear your comments.
> 
> Kind Regards,
> Kamil Tekiela

Hi,

In the paragraph “Difference between PDO and mysqli”, you propose:

“Array keys are completely ignored. mysqli doesn't have emulated prepares nor does it have
named parameters.”

Instead of ignoring the keys, I think it is better to throw a TypeError when the provided array is
not a “list” in the sense of array_is_list() introduced [in a recent RFC]
(https://wiki.php.net/rfc/is_list). The reasons are:

* provide the user with useful feedback when they are attempting to do something dubious and/or
their intent is ambiguous;
* be forward compatible with possible future addition of named parameters;
* reduce the difference with PDO for input that are accepted in both mysqli and PDO.

—Claude


Thread (5 messages)

« previous php.internals (#113254) next »