Hi all,
A regular problem that new users run into is error handling with PDO.
The current default error mode for PDO is "silent". This leads to the
situation where code doesn't work and returns no obvious errors unless
PDO specific error handling code is explicitly added.
I would like to propose the default error mode be changed from PHP 8 as
I believe this would make PDO error handling much more intuitive for new
developers, preventing the common "my code isn't working and I don't
know why" scenario that occurs.
While a BC break, I believe it's the type of change developers expect in
a major version and I don't believe that explicitly setting the error
mode for code bases that rely on the silent error mode is onerous - many
code bases are already explicitly setting the error mode already.
Given the way error handling has been / is heading in PHP, I would
suggest the default error mode should be exceptions, but I can forsee
arguments for using warnings instead ("less of a BC break" since code
would still continue unless a custom error handler causes an abort, so
closer to the behavior of "silent").
What are peoples views on making this change?
What do you think the new default be (and why)?
(I am aware this change will likely require an RFC)
AllenJB
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php