Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105737 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77962 invoked from network); 17 May 2019 23:13:31 -0000 Received: from unknown (HELO us-smtp-delivery-195.mimecast.com) (216.205.24.195) by pb1.pair.com with SMTP; 17 May 2019 23:13:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenable.com; s=mimecast20170201; t=1558124400; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:autocrypt; bh=ZnYPwtiWonsSUogGdqXWRQDKBINDDKPXB8jvALtdz4w=; b=gSJ9/1UiXxnCYXApgXQlwT2gSNQ3rvk7bMu1lrjU2TWHyIJBUAhXILG4h3PGE7yKuivUjW 3sVvH91/AYrdJxHoaSr522FS3SBJWgfs6YKxavohY3iaC9zyr5i9QK+omqPpV+BCBpoPg/ /k3azkVS3pWgdtbRHnU6nvRLTuYY90I= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145-wPqilpRKNUmjBF6lokUzmQ-1; Fri, 17 May 2019 16:19:58 -0400 Received: by mail-oi1-f199.google.com with SMTP id x193so3301231oix.1 for ; Fri, 17 May 2019 13:19:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=rxasL/Va5QJ9H5cyAJId112C+jPOvFV3El5zj/i9IEs=; b=ZT8hkGrlfcUahsodREUsOP/Bnx/OVgePpGygPjovnDKffL7OTae/SDaLgtvoz6cNrW ZjJWsIIZxsfQVAn17v1bZRkRO9zStPkWJpm/O+0mal/Zeb2hOC47RucVieOj54o7EkCN 08uyozrX17z2gC3qIseB4YN+FFLlAzs31Wo7XdIk0dqnH7KX5juFypENVIQAAZTcyBLp BSlqQb42J7eSDU71XyPZh3xpWhHgrnorpeydiyRzXJJ7b9TK00bkX0NV3fHxf+LyJYlq zeDD69InajQhKipvMmYXq9ygggOA40eZNWd3OymuVMDXrPIt6A5BMY6sSSWGUubbCJ0k OuSw== X-Gm-Message-State: APjAAAUQ+/zGFH0r5o7aE2N5upda0XpBgK/3/4qOwI2Nuecf5uESqPQ5 /baNq+e8UliWMMTAHGqXLg5EjJYrIOcmdser2QNQg7NcJ6bUE75uGoUhXFHlQUyfHUBdGEQoAT0 Hj8/wEecpW15tcW3WHWlX/es2jT5t3nabMA== X-Received: by 2002:a9d:460d:: with SMTP id y13mr9331360ote.244.1558124396669; Fri, 17 May 2019 13:19:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6x6Y9DDVHVOHdq9q8ObA86KugbcAviRR6Ci0+vxV3G8F1SEO2eRMvUSdyfCcM++vI7VZGO3lOnHaXy/WfjYs= X-Received: by 2002:a9d:460d:: with SMTP id y13mr9331321ote.244.1558124396012; Fri, 17 May 2019 13:19:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 May 2019 16:19:44 -0400 Message-ID: To: internals@lists.php.net X-MC-Unique: wPqilpRKNUmjBF6lokUzmQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Changing the default value of SQLite3::enableExceptions() From: rkopack@tenable.com (Robert Kopack) I feel like changing the default value of $enableExceptions to TRUE makes more sense since that is what you would expect from the original function call as it stands and is the least breakage of anything already existing (since making it a required variable would throw ArgumentCountError for any existing code). WRT the PR you mentioned (since it's my own), do you think it would be better to change the current toggleExtendedResultCodes to enableExtendedResultCodes and have a similar function prototype to enableExceptions? I didn't consider that when I wrote my changes (to be honest I don't use the sqlite3 class directly so I didn't know about it, I only used the pdo_sqlite layer above it). On Fri, May 17, 2019 at 3:49 PM Kalle Sommer Nielsen wrote: > > Evening Internals > > 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. > 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() > > Thoughts? > > > [1] https://github.com/php/php-src/pull/4166 > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >