> Le 11 févr. 2021 à 20:43, Kamil Tekiela <tekiela...@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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to