Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105742 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84575 invoked from network); 18 May 2019 12:53:27 -0000 Received: from unknown (HELO mout.gmx.net) (212.227.17.21) by pb1.pair.com with SMTP; 18 May 2019 12:53:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558173603; bh=9sHYrt7bm/m/ZBKdJ03ox7EnP9i7Tci1eYcY94U7F3k=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=ks4GEP729SVhJPkk4N2HhxvXUPUhgN17Uc/7+SSiG9YlkYhBxVerN6gWpDh+nEV70 q0jdERzgumd3I9Kf+AJHaKI6WnnglTs7SVDFLtJ4C+AiG9ge/Sm4xoMY7nnyOeF6P0 K6h9SPeY68kWHwWaeqRiw5GXJSt0LBFPWKMwDSRk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.144] ([84.179.225.210]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MVvPJ-1hHirv44pR-00RoWK; Sat, 18 May 2019 12:00:03 +0200 To: Kalle Sommer Nielsen , Internals References: Message-ID: <1b95b6af-adc5-0f69-b277-9f7c6b30345f@gmx.de> Date: Sat, 18 May 2019 12:00:04 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:gtot5Ey6NBrWZLV9Fy2iOAnLBYO2iCSYiaGi1v3yGBKrvn7dt9M 3R33oiua2MGsnSeF0GnruiwKJFfgPrk1scYjmJp1qSXl7JwWYN6+kLjgYeLZpwt5WWdvYmk 5FxuPdlW6AsSsgng4oBj5dQ1NhWli5YnzZVD+M3x6X+M9xAq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IN1+TtoQDcuqSsw2zedFbPzP8zRQ01cxB1WTrq+ Subject: Re: Changing the default value of SQLite3::enableExceptions() From: cmbecker69@gmx.de ("Christoph M. Becker") On 17.05.2019 at 21:42, Kalle Sommer Nielsen wrote: > 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. ACK. > Observe the current prototype: > SQLite3::enableExceptions ([ bool $enableExceptions =3D 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() ACK. However, I don't think that we can change the default value in the near future for BC reasons. Deprecating (7.4) and removing support (8.0) for calling the method without argument would be the way to go, I think. [In a somewhat distant future, we might consider reintroducing support for argument-less calls, but in this case it might make sense to let the method work as getter (i.e. without argument, it would return the current value without changing it).] > [1] https://github.com/php/php-src/pull/4166 Thanks, Christoph