On Tue, 29 Aug 2023 at 14:52, Saki Takamachi <s...@sakiot.com> wrote:
> 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 > I don't know about removing the silent mode altogether, but I think the warning version is pretty useless. However, if we are going to remove it, it would be nice to have this done consistently across all bundled extensions. >From the top of my head, I know SQLite3 and the Intl extension also have such flags, and possibly the DOM extension too. Best regards. George P. Banyard