Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106828 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94637 invoked from network); 1 Sep 2019 21:33:30 -0000 Received: from unknown (HELO mail-qt1-f171.google.com) (209.85.160.171) by pb1.pair.com with SMTP; 1 Sep 2019 21:33:30 -0000 Received: by mail-qt1-f171.google.com with SMTP id r15so7773514qtn.12 for ; Sun, 01 Sep 2019 12:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=mHuofeMtEgIytgKtojZ4lM6g9EMKi3zYOOe1Y4Avi6U=; b=grc/KjF9KHCvKyLIKwFXniNG1iHjFq3p8eP46apGnebJ8TGuKXqXtytJV7EXqNy3yg p4IB8eQIW3CQqgPxuyOM/KHz5rwNfY3SQqulWDzgsyFs1UWmYkEERFifwpycyYpr3Acu 3JzLidksanVJbMDWbIXvsZvx8W2I+HX1AGiQbtwbrS1BBkjZjaGmSnymjHg3V67htxEu s90iAzvEUPkBC9hSvjw+bBAGdSWkl4JYGgg+Y4kZKJuwNNGUuoZZ1nxfjc+TghFmOuBu N3hILW7yrpmQ6i6GODWKvxiOEUemSADD4BSB1L1vahJWcfZQSLDQXR3zbPzb2A53IzRy AzdA== 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:content-transfer-encoding; bh=mHuofeMtEgIytgKtojZ4lM6g9EMKi3zYOOe1Y4Avi6U=; b=HxfpwVU866fVc1OqobuKKu7B5teEaPhzwbbn80Zvzq5AzQ2tzeC7aix1bQ3AAgqGT1 H3YiRwQtaSi50TrXV3iuvQFOmJ1Ko7aXOU+eGWOV3zwoC42fVCuXnhjYMxOpU/yh77KN ZWlneVPbEO08uCsdYUSdYz1HVIBLCb+NnsK0yP++o/yZ8EQATVZCjTIF0Fa7YSUkTJWz rG8WrvWDRLqNlmT2bUwLAWf4OP2e7KrrQrCbhilLMZUIhvgNDkSix/f3vnm4l/mTgqgy JjmddNFDoYrGDFuuzkyNtRiIsV/obzoW//Rgi4Pd5KjFLW2UC3B2EGQcCXOt5Qd+GnwU JVNg== X-Gm-Message-State: APjAAAWg3XQZ6BnJqV2sF2bt1cRLc7thiIe6Kch/KkGrB5dCabPuW3n5 Qc+XIm6yHKFI/+820CcVtFzXB7I2Tzo= X-Google-Smtp-Source: APXvYqxU5xJHM5ALKG575LDfehH+JCY7gKE5YzjsoyKG0EllYe3As4k3FTBJxMJY0W+Yjl0TFQBCMg== X-Received: by 2002:ac8:4247:: with SMTP id r7mr25781085qtm.219.1567364802201; Sun, 01 Sep 2019 12:06:42 -0700 (PDT) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com. [209.85.160.171]) by smtp.googlemail.com with ESMTPSA id c14sm5599268qta.80.2019.09.01.12.06.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Sep 2019 12:06:41 -0700 (PDT) Received: by mail-qt1-f171.google.com with SMTP id r15so7773457qtn.12 for ; Sun, 01 Sep 2019 12:06:40 -0700 (PDT) X-Received: by 2002:ac8:5354:: with SMTP id d20mr24629886qto.119.1567364800509; Sun, 01 Sep 2019 12:06:40 -0700 (PDT) MIME-Version: 1.0 References: <702735435.20836.1567008353931@email.ionos.de> <1184971592.96503.1567221786282@email.ionos.de> In-Reply-To: <1184971592.96503.1567221786282@email.ionos.de> Date: Sun, 1 Sep 2019 21:06:28 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Thomas Bley Cc: Matthew Brown , Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: andreas@dqxtech.net (Andreas Hennings) I think we should distinguish two separate problems in the discussion: 1. Undeclared local variables in function scope. Some poeple here think this "lazy" way of coding is actually more productive. Fixing such places would be straightforward.. except that it may require patching some legacy 3rd party code. 2. Undeclared values, or values of unexpected type, in variables coming from elsewhere: - variables used in file scope, e.g. in template files, which are declared in a different file. - any global variables. - values in nested arrays, which might have been set in some other place before they get passed to the current function. Typically these cases are hard to fix and troubleshoot. Especially, even if you think you fixed it, there can be some dynamic conditions that are really hard to test. E.g. if the username begins with a capital letter, the variable will be undefined, or a specific array value will be an object instead of a string.. Ideally such systems should be avoided, or they will need a lot of try/catch to deal with such problems in the future. But a lot of legacy code was not written with sufficient sanity checks, and accepts the occasional or regular notice. Perhaps is about time for this level of breakage in PHP8. I just want us to be aware of it. On Sat, 31 Aug 2019 at 05:23, Thomas Bley wrote: > > That's a good point, maybe a compromise is this: > > > That way new users can always use > Regards > Thomas > > > Matthew Brown hat am 28. August 2019 um 18:2= 1 geschrieben: > > > > > > FWIW: all the runtime notices in our codebase come from internally-crea= ted code. > > > > Requiring declare(strict_variables=3D1) to get this (better) behaviour = punishes future users of PHP for our past mistakes. > > > On Aug 28, 2019, at 12:05 PM, Thomas Bley wrote= : > > > > > > Normally every code base has old and new code, some is actively maint= ained, some is probably third-party maintained, some is unmaintained. Busin= ess normally not calculates costs for upgrading, securing, GDPRing old code= , so bigger changes always leave some people behind. yes.. > > > I would prefer to write new code with sth like declare(strict_variabl= es=3D1); or declare(SomeNamespace\Foo:strict_variables=3D1); That way, peop= le can write new code in a better way, include new libraries and upgrade ol= d code piece by piece without any big pressure. > > > > > > Regards > > > Thomas > > > > Matthew Brown hat am 28. August 2019 um = 17:32 geschrieben: > > > > > > > > > > > > It's essentially tech debt, and the language has allowed its users = to > > > > accrue a ton of it. > > > > > > > > The longer that's allowed (deprecations/warnings prolong the issue = in my > > > > opinion) the harder it will be to fix the issues. > > > > > On Wed, 28 Aug 2019 at 10:56, Rowan Collins wrote: > > > > > On 28 August 2019 15:22:22 BST, Matthew Brown > > > > > wrote: > > > > > > Looking at our notice logs, I estimate (fairly roughly) that it= would > > > > > > require about a week's worth of my time to fix these issues > > > > > I honestly thought you were posting that as an argument against. = A week of > > > > > resource (plus the accompanying QA impact etc) is a significant i= nvestment > > > > > for many organisations. That's why it has the potential to delay = adoption > > > > > of a new version, and why a long lead-in via deprecation or opt-i= n is > > > > > necessary. > > > > > Regards, > > > > > -- > > > > > Rowan Collins > > > > > [IMSoP] > > > > > -- > > > > > PHP Internals - PHP Runtime Development Mailing List > > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >