Re: Changing the default PDO error mode
| From: | AllenJB | Date: | Sat, 21 Mar 2020 14:32:43 +0000 |
| Subject: | Re: Changing the default PDO error mode | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109178@lists.php.net to get a copy of this message | ||
On 19/03/2020 12:25, Christian Schneider wrote:
Am 19.03.2020 um 10:31 schrieb Matteo Beccati <php@beccati.com>:To clarify: I'm not proposing the silent error mode be removed - it would still exist and developers would be able to switch (back) to it simply by explicitly setting the error mode when creating a PDO object. How do you see that a deprecation would be implemented for this change? A deprecation notice each time a PDO object is created without explicitly setting the error mode? Is this not just as disruptive to existing code as changing the default error handling to warnings? For new users I can see it being more so: Every time a new developer follows an older example they're going to be asking about this deprecation message (or worse, changing error_reporting or using @ to silence it!). Without a deprecation phase, existing examples will continue to work (errors will just be reported differently, but no in an unintuitive way in my opinion) AllenJBI agree defaulting to PDO::ERRMODE_EXCEPTION is a sensible change for PHP8.I think this should go through a deprecation phase first as it is a BC break, no matter how easy to fix you think it is. - Chris