rfc:sqlite3_exceptions
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:sqlite3_exceptions [2022/10/24 02:40] – created bohwaz | rfc:sqlite3_exceptions [2023/07/17 04:06] (current) – Add links for implementations girgias | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: use Exceptions | + | ====== PHP RFC: Use exceptions by default |
* Version: 0.1 | * Version: 0.1 | ||
* Date: 2022-10-24 | * Date: 2022-10-24 | ||
* Author: BohwaZ, php at bohwaz dot net | * Author: BohwaZ, php at bohwaz dot net | ||
- | * Status: | + | * Status: |
+ | * Implementation: | ||
* First Published at: http:// | * First Published at: http:// | ||
Line 9: | Line 10: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | The SQLite3 extension is still using PHP warnings by default. PDO is using Exceptions, like everyone else. | + | The SQLite3 extension is still using PHP warnings by default. PDO is using exceptions, like everyone else. |
It's time to move to exceptions. | It's time to move to exceptions. | ||
Line 15: | Line 16: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | | + | Progressively deprecate warnings (PHP 8.3), make exceptions the default (9.0) and remove warnings (10.0). |
- | * Make SQLite3 throw exceptions of class SQLite3Exception by default | + | |
- | * Remove the SQLite3:: | + | In PHP 8.3: |
- | * Move SQLite error code off the error message | + | |
+ | | ||
+ | * Remove SQLite3 error code from the error message, and assign it to the exception code | ||
+ | * Make '' | ||
+ | * Calling '' | ||
+ | * Default behavior is still to raise warnings ('' | ||
+ | |||
+ | In PHP 9.0: | ||
+ | |||
+ | * Make SQLite3 throw exceptions of class '' | ||
+ | * Calling '' | ||
+ | * It's not possible | ||
+ | * Calling '' | ||
+ | |||
+ | In PHP 10.0: | ||
+ | |||
+ | * Remove the '' | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | * Calls to SQLite3:: | + | In PHP 8.3: |
- | * Code relying on hiding warnings will break | + | |
+ | * Code parsing the error message to get the error code may fail as the error code has been moved to be consistently at the end of the error message string. This is unlikely as the proper way is to use '' | ||
* Code already relying on exceptions will not see a difference, as previously \Exception was thrown, and \SQLite3Exception is a subclass of \Exception | * Code already relying on exceptions will not see a difference, as previously \Exception was thrown, and \SQLite3Exception is a subclass of \Exception | ||
- | Another option could be to keep the enableExceptions | + | In PHP 9.0: |
+ | |||
+ | * Calls to SQLite3::enableExceptions(false) will break | ||
+ | * Code relying on hiding warnings will break | ||
+ | |||
+ | In PHP 10.0: | ||
+ | |||
+ | * Calls to '' | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | Next PHP 8.x (8.3?) | + | PHP 8.3, 9.0, 10.0 |
===== RFC Impact ===== | ===== RFC Impact ===== | ||
Line 64: | Line 89: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
- | * Proposal | + | * 1: accept proposal |
- | * Proposal | + | * 2: don' |
- | * Choice 3: no change | + | |
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | Pull request: https:// | + | Pull request: |
+ | |||
+ | * 8.3: https:// | ||
===== Implementation ===== | ===== Implementation ===== | ||
Line 82: | Line 108: | ||
===== References ===== | ===== References ===== | ||
- | Links to external references, discussions or RFCs | + | * https:// |
+ | |||
+ | |||
+ | |||
+ | ===== Vote ===== | ||
+ | |||
+ | Voting started 2023-05-09 and has ended end 2023-05-23, Europe/ | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
- | ===== Rejected Features ===== | ||
- | Keep this updated with features that were discussed on the mail lists. |
rfc/sqlite3_exceptions.txt · Last modified: 2023/07/17 04:06 by girgias