Evening Internals
While reviewing a PR[1], which proposes to add two new methods to
ext/sqlite3, one being an option to toggle on/off, I've noticed that
there already is another method which also enables the extension to
toggle on/off behavior, in this case; whether or not to throw
exceptions instead of warnings.
This method have a rather poor naming considering its default value.
Observe the current prototype:
SQLite3::enableExceptions ([ bool $enableExceptions = FALSE
] ) : bool
What this means is that code like this may not do what you actually
think it does:
$link->enableExceptions();
Due to the $enableExceptions parameter being default to false. I'm
writing this email to get some feedback on thoughts regarding changing
this default value to true (current thinking is PHP8) or simply
dropping the default value, forcing users to specify whether or not to
enable exception mode.
I personally think its better to simply deal with the default value
rather than making a bigger potential BC break by renaming the method
to something like: SQLite3::toggleExceptions()
Thoughts?
[1] https://github.com/php/php-src/pull/4166
--
regards,
Kalle Sommer Nielsen
kalle@php.net