rfc:mysqli_bind_in_execute

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:mysqli_bind_in_execute [2021/02/11 19:36] – Added procedural example dharmanrfc:mysqli_bind_in_execute [2021/04/17 16:46] – Implemented dharman
Line 1: Line 1:
 ====== PHP RFC: mysqli bind in execute ====== ====== PHP RFC: mysqli bind in execute ======
-  * Version: 1.0+  * Version: 1.1
   * Date: 2021-02-11   * Date: 2021-02-11
   * Author: Kamil Tekiela, dharman@php.net   * Author: Kamil Tekiela, dharman@php.net
-  * Status: Under Discussion+  * Target version: PHP 8.1 
 +  * Implementation: https://github.com/php/php-src/pull/6271 
 +  * Status: Implemented
  
  
Line 10: Line 12:
  
 ===== Proposal ===== ===== Proposal =====
-I would like to propose adding a new optional argument to %%mysqli_stmt::execute()%% same as PDO does with %%PDOStatement::execute()%%. The goal of this proposal is to simplify mysqli usage with a simple fix which does not require major refactoring.+I would like to propose adding a new optional argument to %%mysqli_stmt::execute()%% same as PDO does with %%PDOStatement::execute()%%. The goal of this proposal is to simplify mysqli usage with a simple fix that does not require major refactoring.
  
 This proposal tries to address the following mysqli limitations: This proposal tries to address the following mysqli limitations:
Line 61: Line 63:
 While the idea came from PDO bind-in-execute implementation, the mysqli proposal differs in two small ways. While the idea came from PDO bind-in-execute implementation, the mysqli proposal differs in two small ways.
  
-  - Array keys are completely ignored. mysqli doesn't have emulated prepares nor does it have named parameters. Relying on the array keys/indices would make the implementation unnecessarily complex and it would cause unintentional confusion.+  - Only list arrays are allowedThis is because mysqli doesn't have support for named parameters like PDO doesIf an associative array is passed then a ValueError will be thrown. The implementation uses [[rfc:is_list]].
   - Re-binding empty array throws an error in mysqli. PDO simply ignores an empty array and continues to use previously bound values.   - Re-binding empty array throws an error in mysqli. PDO simply ignores an empty array and continues to use previously bound values.
  
Line 69: Line 71:
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
-None that I can find.+Classes extending %%mysqli_stmt::execute()%% will be required to specify the additional parameter now.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-Next PHP 8.x+Next PHP 8.X (8.1)
  
 ===== RFC Impact ===== ===== RFC Impact =====
Line 82: Line 84:
 ==== php.ini Defaults ==== ==== php.ini Defaults ====
 None. None.
- 
-===== Open Issues ===== 
- 
  
 ===== Unaffected PHP Functionality ===== ===== Unaffected PHP Functionality =====
Line 94: Line 93:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
 Simple yes/no vote. Simple yes/no vote.
 +
 +Voting started on 2021-03-08 and ends on 2021-03-27
 +
 +<doodle title="MySQLi bind-in-execute" auth="Dharman" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
Line 106: Line 112:
  
 ===== References ===== ===== References =====
-Links to external references, discussions or RFCs +https://externals.io/message/113149
- +
-===== Rejected Features =====+
  
rfc/mysqli_bind_in_execute.txt · Last modified: 2021/06/11 11:55 by dharman