Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109178 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44953 invoked from network); 21 Mar 2020 16:09:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Mar 2020 16:09:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C00DE1804F2 for ; Sat, 21 Mar 2020 07:32:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8943 85.119.80.0/21 X-Spam-Virus: No X-Envelope-From: Received: from mail.apserver.co.uk (server2.alteredperspective.co.uk [85.119.82.103]) by php-smtp4.php.net (Postfix) with ESMTP for ; Sat, 21 Mar 2020 07:32:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.apserver.co.uk (Postfix) with ESMTP id 39D724F4064 for ; Sat, 21 Mar 2020 14:31:53 +0000 (GMT) Received: from mail.apserver.co.uk ([127.0.0.1]) by localhost (server2.alteredperspective.co.uk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id K2wZZ_kzYe3P for ; Sat, 21 Mar 2020 14:31:50 +0000 (GMT) Received: from [192.168.0.6] (cpc113420-maid7-2-0-cust1808.20-1.cable.virginm.net [86.18.119.17]) by mail.apserver.co.uk (Postfix) with ESMTPA id CC7F84F4061 for ; Sat, 21 Mar 2020 14:31:50 +0000 (GMT) To: internals@lists.php.net References: <99c00084-c212-ad23-628e-87f35e2de849@allenjb.me.uk> <782751cf-0058-4dae-9f5a-40648a79986d@www.fastmail.com> Message-ID: <6315d670-723e-9801-07ad-bd9a3f00934d@allenjb.me.uk> Date: Sat, 21 Mar 2020 14:32:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Changing the default PDO error mode From: php.lists@allenjb.me.uk (AllenJB) On 19/03/2020 12:25, Christian Schneider wrote: > Am 19.03.2020 um 10:31 schrieb Matteo Beccati : >> I 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 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) AllenJB