Deprecate PDO::ATTR_ERRMODE [Proposed RFC]
| From: | Saki Takamachi | Date: | Tue, 29 Aug 2023 13:51:56 +0000 |
| Subject: | Deprecate PDO::ATTR_ERRMODE [Proposed RFC] | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-120945@lists.php.net to get a copy of this message | ||
Hi, internals.
I thought about various things to improve the current situation where
PDO::ATTR_ERRMODE
is not working very smartly.
Exceptions may be thrown regardless of the setting of PDO::ATTR_ERRMODE.
https://www.php.net/manual/en/pdo.rollback.php#refsect1-pdo.rollback-errors
Another annoyance is that PDO::ERRMODE_SILENT sometimes gives a warning.
This is an undocumented phenomenon, and it's a 19-year-old vintage bug.
https://github.com/php/php-src/blob/223fb08819967b3063610289a5783944a85d6d65/ext/pdo/pdo_dbh.c#L74
Based on these, I feel that the reliability of the attribute value PDO::ATTR_ERRMODE is low and
there is not much meaning in its existence as an attribute value.
Since the default behavior became PDO::ERRMODE_EXCEPTION in PHP8.0.0, I think it would
be better to abolish it rather than leave it halfway.
I think this is a big change, so I'm assuming 9.x+ even if it's implemented.
I will do the implementation myself.
Please let me know what you think.
Thank you.
Saki