Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105735 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66108 invoked from network); 17 May 2019 22:36:35 -0000 Received: from unknown (HELO mail-pf1-f180.google.com) (209.85.210.180) by pb1.pair.com with SMTP; 17 May 2019 22:36:35 -0000 Received: by mail-pf1-f180.google.com with SMTP id c6so4140198pfa.10 for ; Fri, 17 May 2019 12:43:03 -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:from:date:message-id:subject:to; bh=/0zNW3f2ZDjUqi/8xO5zS/tLh9WI7e8jwrcNiwW4++o=; b=l8c6RN6hFg82lYrw61FfvwgM/JezOeqsmhU1V6fXH9Vu1JMcCFb0egmjXVZfSWUnG1 y61hnBu2cLx1DX2RMX8tx8e5IOrAl7W6/FIcWvQkLiC5Mg2Lbq0BDRrMi8Oc2etGwyZN /jAwCpw+FpHrQ3I0ltcWUZDJR06M4149aMaVXUEAllcSHPni++L1Evz1scPiAT1vikcO RMlaVX7vUkW0tQAuKCVPttQU8meUwYt7shcygTeQw9V6VU6YogeEdkx7hhpP4FVgDRKt hznW2YYHDzu/ckE11u7HEPcZAWOG8e4Gu/upJ37ctF0PopRx6MbwzGAtbsSp6CnYLedR f8rw== X-Gm-Message-State: APjAAAXDrkIv6Vwy0HWh9Td+Mj3495swtglhK/KN9Wr6YBmyMnBJNsK2 5dK1wChRN5Ptx7MCzE69542lbTbytRZwjcBndG9Aj9qv15osVEHi X-Google-Smtp-Source: APXvYqzoFSO63PztKJy4M6DivCe5CQ+jqNXfI+A5ebS3MuCWZ8ayiejIYoO8qptcLOsIpqzPrDgBdN/KpadC9MJ76/Y= X-Received: by 2002:a63:d04b:: with SMTP id s11mr59282488pgi.187.1558122181621; Fri, 17 May 2019 12:43:01 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 17 May 2019 22:42:49 +0300 Message-ID: To: Internals Content-Type: text/plain; charset="UTF-8" Subject: Changing the default value of SQLite3::enableExceptions() From: kalle@php.net (Kalle Sommer Nielsen) 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 = 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