rfc:improve_mysqli

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:improve_mysqli [2020/12/30 18:01] – Removed invalid quote dharmanrfc:improve_mysqli [2020/12/30 18:26] – typo dharman
Line 43: Line 43:
 === mysqli::init() is confusing, unnecessary, and not an alias of mysqli_init() === === mysqli::init() is confusing, unnecessary, and not an alias of mysqli_init() ===
  
-Despite what the documentation says, ''mysqli::init()'' is not an OOP version of ''mysqli_init()''. In fact, such a claim makes absolutely no sense, given that ''mysqli_init()'' was meant to create an empty instance of mysqli without calling the connect method. In reality, ''mysqli::init()'' is just a thin wrapper for ''%%mysqli::__construct()%%'' with 0 arguments. Gicen the nonsensical nature of this method I am proposing to [[https://github.com/php/php-src/pull/6409|deprecate it in PHP 8.1]]. +Despite what the documentation says, ''mysqli::init()'' is not an OOP version of ''mysqli_init()''. In fact, such a claim makes absolutely no sense, given that ''mysqli_init()'' was meant to create an empty instance of mysqli without calling the connect method. In reality, ''mysqli::init()'' is just a thin wrapper for ''%%mysqli::__construct()%%'' with 0 arguments. Given the nonsensical nature of this method I am proposing to [[https://github.com/php/php-src/pull/6409|deprecate it in PHP 8.1]]. 
  
 The only valid use case for this method was in polymorphism, which can be replaced with a constructor. The only valid use case for this method was in polymorphism, which can be replaced with a constructor.
Line 248: Line 248:
 The existing prepared statement parameter binding will remain unaffected. There will be no change to ''mysqli_stmt::bind_param()'' The existing prepared statement parameter binding will remain unaffected. There will be no change to ''mysqli_stmt::bind_param()''
  
-The existing procedural style connection will remain the same. The only potential difference would be that `mysqli_connect()with 0 arguments no longer opens the default connection. +The existing procedural style connection will remain the same. The only potential difference would be that ''mysqli_connect()'' with 0 arguments no longer opens the default connection. 
  
-Opening the connection while setting options before will remain the same in procedural form. Setting the connection flags will also remain the same with the only difference that it will now become available using the normal `connect()method too.+Opening the connection while setting options before will remain the same in procedural form. Setting the connection flags will also remain the same with the only difference that it will now become available using the normal ''connect()'' method too.
  
 ===== Future Scope ===== ===== Future Scope =====
rfc/improve_mysqli.txt · Last modified: 2020/12/30 18:27 by dharman