Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109139 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 34692 invoked from network); 19 Mar 2020 11:08:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Mar 2020 11:08:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7A15E1804D3 for ; Thu, 19 Mar 2020 02:31:52 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from box.beccati.com (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 19 Mar 2020 02:31:51 -0700 (PDT) Received: from authenticated-user (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by box.beccati.com (Postfix) with ESMTPSA id 7D24C200313; Thu, 19 Mar 2020 10:31:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=beccati.com; s=mail; t=1584610309; bh=fKj5xieveyRLqf9AWZlVCirlWXklcgrs1FrD43sa5HM=; h=Subject:To:References:From:Date:In-Reply-To:From; b=XSAjg+US2OuHzui0BZDwaKoougsUMDVfEp44FhQ2qhoZukJ//FPwXbZcqGrC2L98j XngUxm67gUYpnCrcPUBTTizD/bhWOcsmTAKKCej1vCaFiIgOgzYKx6jaijaee196Ex YtGaAxhm4hF69FW15xYVL8QkG/RY68dk2s83FBmLm6ptoS4EP9Jq08l3Oyam4g6o9u Gt1sgDz7zfR1vQxPhzUGlCILsLunR1rUauEeeapI9H7u9W/n+5m5vvUMzXWJpimLMr WlSvTtfqbASEUjVq+OHV/OXRYPgCC4pI+JfXpAb54JaNy3YWQ3QZMERpPxM/UsMmWq PbIhgkmoK1psA== To: Larry Garfield , php internals References: <99c00084-c212-ad23-628e-87f35e2de849@allenjb.me.uk> <782751cf-0058-4dae-9f5a-40648a79986d@www.fastmail.com> Message-ID: Date: Thu, 19 Mar 2020 10:31:48 +0100 MIME-Version: 1.0 In-Reply-To: <782751cf-0058-4dae-9f5a-40648a79986d@www.fastmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Changing the default PDO error mode From: php@beccati.com (Matteo Beccati) Hi, On 14/03/2020 22:10, Larry Garfield wrote: >> What do you think the new default be (and why)? >> >> (I am aware this change will likely require an RFC) >> >> AllenJB > > I see only two options: > > 1) Do nothing. > > 2) Move to Exceptions. > > I've never used PDO and not set it to Exceptions, honestly. Adding more global error conditions to code is a terrible idea, so let's not do warnings. If your query breaks, you really shouldn't continue because your data is busted so your following code will fail ungracefully at best, or corrupt data at worst. > > Changing a default like this seems a reasonably safe thing to do in a major, as long as it's still just as easy to switch back to silent mode for those who prefer to be explicit. I agree defaulting to PDO::ERRMODE_EXCEPTION is a sensible change for PHP8. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/