Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112997 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44977 invoked from network); 26 Jan 2021 16:16:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Jan 2021 16:16:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 136311804E3 for ; Tue, 26 Jan 2021 07:57:56 -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.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 ; Tue, 26 Jan 2021 07:57:55 -0800 (PST) Received: by mail-ed1-f45.google.com with SMTP id c2so20070278edr.11 for ; Tue, 26 Jan 2021 07:57:55 -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=zODDxZlSOBNTpUYgt+Cx2W9xXsU3BfGI1fJr83Y4cbI=; b=fdRooe9qbNYEwsRXJjJmNQ2hHritleJUpa6iyIlVLXWc5F+IGV0WR/6LS1f8TCQiNk mFot3OWMDj8+0qNoh8CZjcL3XComiNkX7kGkXl15Wa3InIZp23ddP5mssrUzW4jnE1DA JMN6nS+vIB5ph7Iz0VFTXAKcAAgxUwyRnlsL6BQgyhQ3PpUjDbAhn1tu/aeC3UNf7wYe jzZBWlNRQgIXPM/bWUJpWXxk+3sYJWfm9MSvGBxXQrSfYVYN6Gfzq4binaQvRZ4MK81x T4NW3cllgFgGEMIvjfoe5ky9V5ZCoDYRUYUUhvwhJGl89Ezj+xpPkZ3g/se5l81OUQMy AdOQ== 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=zODDxZlSOBNTpUYgt+Cx2W9xXsU3BfGI1fJr83Y4cbI=; b=gG7eu+OgwRqCx8Nrgd4N2tn2h0lR3ABqPyjQnzUPMyLWfUYNUHbCTjR+ph9l5/H2vG Z9DOajrLrLORs113CEtkTU0S/VoNUbsYN9nbUEMEufgKR1lOdLfo0Zr0Z8B0768wcTLt rp+bdfCNpHub4KyahwOs6ZBXyb2CGlNdFFn8Fh18nIDD875p+yzsCm+SPOJJuhfAH7rg wMh5Z2ZvKbQMqMnCq3aR3qE3IjkfibqG6SXelrt+rwuiuxK7M0GaN7UwcitBH17D5GvS AGEr0B+Bipb3XdXw7FEU/SLlPzhocHmy7Ap0UX9IOHoM5Dge9c7S+LboHTmMVI760NIb C/jw== X-Gm-Message-State: AOAM531qSEqwwLeZQ46anZCulapWHrcf59w2Vn4YhhYUIdnj8sJZfVh6 KtACJf2CRUVB+nInv16t4lmL2cfkt3giT7xdSt0= X-Google-Smtp-Source: ABdhPJy5+A95ARrX0GGPnVhdTNbvvaX+EoSH81c4Jzy/GxvQqRUczA366kFLJ4T0DkAhkOtaYkogBebtARVYsRAU7Ts= X-Received: by 2002:aa7:cb42:: with SMTP id w2mr5189120edt.21.1611676672559; Tue, 26 Jan 2021 07:57:52 -0800 (PST) MIME-Version: 1.0 References: <0edafce4-c9a5-c483-65f1-72e49614135a@telia.com> <4D7D042F-39A5-4BEF-93B6-542FD53928A1@cschneid.com> <73C12DD2-D99E-44BA-B557-6043F3DDD4C7@cschneid.com> In-Reply-To: <73C12DD2-D99E-44BA-B557-6043F3DDD4C7@cschneid.com> Date: Tue, 26 Jan 2021 15:57:41 +0000 Message-ID: To: Christian Schneider Cc: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , PHP internals Content-Type: multipart/alternative; boundary="0000000000008f8c2905b9cfb7fd" Subject: Re: [PHP-DEV] [RFC]: Change Default mysqli Error Mode From: tekiela246@gmail.com (Kamil Tekiela) --0000000000008f8c2905b9cfb7fd Content-Type: text/plain; charset="UTF-8" I would like to say that I completely agree with George. The BC is minimal. We are not introducing any new functionality or removing any either. We are just changing a default setting that was always there. The only code that would be affected is the one that is currently relying on the default setting. Most of the mysqli code should already have the setting enabled/disabled explicitly. If your current code has mysqli error reporting disabled then nothing will change for you. If your current code has mysqli error reporting enabled then nothing will change for you. It will only change in the code that doesn't have it enabled/disabled yet. Such a project would need to decide whether to enable it or disable it. This can be done even now, and it should be done now, regardless of whether this RFC is accepted or not. > 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. IMHO the warning mode is useless as it doesn't stop the code execution automatically but still throws an error. You either enable error reporting in the form of exceptions, or you keep it silenced. I believe changing the default mode to warning mode makes no sense. Bear in mind that you can do it right now. There's no need for you to wait for PHP 8.1 to see the change. You can decide on the error reporting mode right now. However, I fail to see how mysqli_report(MYSQLI_REPORT_ERROR) could help in migrating the code. As long as your code doesn't have any errors, the error reporting mode will make no difference. > 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. Enabling warning mode will not help you in finding places where you are missing manual error handling. That is the whole point. Manual error handling means that you have to do it manually. When you enable warnings or exceptions then manual error handling is already useless. If you think that your code is missing some manual error handling then enabling warning/exception mode will not reveal to you where these places are. You have to go line by line through your code and everwhere you see a mysqli method/function call you have to add manual error handling. I want to make things straight. Changing the default error mode is not forcing anyone to use exception mode out of the sudden. You can still continue to use whichever mode you are using right now. The change is aimed at people who start their new projects with PHP 8.1 and want to learn mysqli. > I don't see what testing needs to be done, you're reverting to the previous state which supposedly is already working. I also do not know what kind of additional testing would be required. The functionality stays the same. A project code should remain the same unless its maintainers decide to refactor it. All that is needed is to make sure that the project has the correct mode enabled and does not rely on the default setting. --0000000000008f8c2905b9cfb7fd--