Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112991 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68031 invoked from network); 25 Jan 2021 17:41:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jan 2021 17:41:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7E4371804CF for ; Mon, 25 Jan 2021 09:22:25 -0800 (PST) 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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 25 Jan 2021 09:22:24 -0800 (PST) Received: by mail-ed1-f52.google.com with SMTP id g1so16393288edu.4 for ; Mon, 25 Jan 2021 09:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dD39jqZKN+gPcqOLFHvxJ+UJQxdMcZbMSaV8xPH3ge4=; b=a7knAzMCoDLXh27ZIpkF1RPpfgKCpAd84iirqUEMQ1lVQSsUsJUtKIhTpdTn6UUpeB Bn1gMkPEIxVeXr7ZfU/Ihochsz7lMUFdq2lQfB4bkpN7u4W5uw3PXf+RSOkSytywAW+9 UguduBhOSn0xyp6jE9CPjFK3ZR+xZfkBGqPmXKSD70lLPN9nKc+KnmPWGgATGsFW4Ybw v7B+KNOnVh+MhjKsTmJLYKmDvHq57iAIDCYdoispclZjYsSpBMkrS2jZqmUONorJP058 6t5rShsU2V6s9snZoE96LE+M1JrSQ2vILt183kPcKChWHX1vMq+Cn2F1K6maA+fQjeg6 f0cw== 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:cc; bh=dD39jqZKN+gPcqOLFHvxJ+UJQxdMcZbMSaV8xPH3ge4=; b=VD+DCV+phzNyQZpkhuysmsbnsJIN/VWoefuU/oYUWCm1Pst7ypuL3BjZubWxZVKWGa l4T2lEuLkBoSFuiIz8Z5Mu47JS50BZf82unKnhJvBfWz3sOIsNioKo3gM4KWrGjMajhA +WNEQpEkEju4+HOFvON+OdS7Z/1coSZdhbfvs/L3ybt2CB5AwtKqJqUbsSREd15tLAet 80R8NnWJgdrKG6vfPWDy0VEy/2Qj5Nc7kClE7NUEcI5BfqMRl/BQp8tjR/ZtKjF2fUxA 0HICo+sERtbkv8oi9/1dB+N7KY6ZBREB/uOZAenG+6E+WQuayNpmg/r9afa3dJMkLxrq 8PWQ== X-Gm-Message-State: AOAM530X5xESwG1sTrjUai+fbWc3IUYVlkXhKwpQag0+tQo/OjFnbZZq eRTI2upYa1FD0BlPBk+vy1eeP/9wkbdfMpdxmFE= X-Google-Smtp-Source: ABdhPJzLJ7tEaCrSpi7CBmFzE64cItlyEgTOA/8Ysjw79wc7928j8oJNEUBzplyiIX+58eOG72/xMhIwhUNT30kMWDo= X-Received: by 2002:a05:6402:3116:: with SMTP id dc22mr1279944edb.325.1611595342738; Mon, 25 Jan 2021 09:22:22 -0800 (PST) MIME-Version: 1.0 References: <0edafce4-c9a5-c483-65f1-72e49614135a@telia.com> In-Reply-To: Date: Mon, 25 Jan 2021 17:22:12 +0000 Message-ID: To: Christian Schneider Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ecf87105b9bcc71f" Subject: Re: [PHP-DEV] [RFC]: Change Default mysqli Error Mode From: george.banyard@gmail.com ("G. P. B.") --000000000000ecf87105b9bcc71f Content-Type: text/plain; charset="UTF-8" On Mon, 25 Jan 2021 at 16:25, Christian Schneider wrote: > Am 25.01.2021 um 16:59 schrieb G. P. B. : > > The BC break is totally minimal as it's a one line of code that needs to > be added (and for all intent and purposes should already be done). > > That does not change the fact that it is a BC break which should be > treated accordingly. > > You are basically advocating people should add > mysqli_report(MYSQLI_REPORT_OFF) to their setup which will totally defeat > the purpose of the change. > Or (probably more what you have in mind) that they should add > mysqli_report(MYSQLI_REPORT_ERROR) now (to prepare for the change) and > switch to MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT later once they know > they are ready. > And this is exactly what I think should be done by the PHP default so > people don't have to go through this manually. > > > Moreover, I'd rather we get rid of the warning modes all together as > they make the least sense to me. > > Either you're handling the failures explicitly anyway and you use the > silent mode, or you don't and want it to throw with the exception mode. > > This is where you are missing a key component: I want to go through a > phase where I will notice parts where manual error handling (or exception > handling after the change) is missing without having my application abort. > This is what warnings are good for. > > To some of us this is a very valuable step when upgrading. > > - Chris > I've never said there is no BC break, and frankly this change (and other similar ones) should probably have been done in PHP 8 at the same time with PDO. And yes I'm basically advocating for people to add mysqli_report(MYSQLI_REPORT_ERROR) (or even mysqli_report(MYSQLI_REPORT_OFF) if they fancy) to their setup, I'm even advocating for them to do it *right now* such that they can catch anything ahead of time. Moreover, this proposal does not prevent you from using the warning mode instead of jumping to exceptions directly, the key point is that you need to specify it, and I personally believe that having the warning mode as the *default* mode is the worst choice for the reasons I mentioned previously. The removal of the warning modes is completely orthogonal to this proposal, and I agree it is a very useful tool for transitioning to the exception mode, but this transition can already be done in PHP 5, 7 and 8. The grace period for completing this transition is from whenever you want to whenever, if ever, the warning mode gets deprecated and removed. On the note that a one line code change is not a good enough justification for saner defaults, I don't know what to say. At worst you need to find all usages of a connection start and add the line to downgrade the error reporting (even to silence if too many warnings are emitted). I don't see what testing needs to be done, you're reverting to the previous state which supposedly is already working. Best regards, George P. Banyard --000000000000ecf87105b9bcc71f--