Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106745 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17959 invoked from network); 28 Aug 2019 18:38:33 -0000 Received: from unknown (HELO mail-wr1-f47.google.com) (209.85.221.47) by pb1.pair.com with SMTP; 28 Aug 2019 18:38:33 -0000 Received: by mail-wr1-f47.google.com with SMTP id s18so415785wrn.1 for ; Wed, 28 Aug 2019 09:10:44 -0700 (PDT) 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=V54g1iNl6MlGD0K/bfmrgLOKxXC1SYZpfipDsQeAX1o=; b=Z0PuIYlomi+NJLQySIlIEW5RimTPqL59cp7VLNV1aGqFBVmw4vmpMoRLrS3oTsue5s JcuWNZnYQscgLHAgb+u0Pz57GstVpQXu93C+sCZtAg3xFY+e/PAsr9NWfVucXQcy8jz8 Plb0fX8jvHmas4C73zMGW70sWE8Cn4dyPgcRyrMgiN8uyGKcv/DpmvShLhQmhSvOHRMx FZ3YtggCpX2j4VKiVkG20SKn9oikNOHZFSiONsJ4ubdCmgxrfjjMoIcIlSH4Bb0uL/su EM/3LOHyafAtFKIlCnf4NRYthUgHzPIJ65fVXxdt9aiMydfxJlxyFIxRoJSra9O702jY M/Iw== 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=V54g1iNl6MlGD0K/bfmrgLOKxXC1SYZpfipDsQeAX1o=; b=IDjFQ1Oz5PCs5WHin5FGEcgyrXdHH7JFpd6NeJh1vDMUYU0SZoFue/Xo4z3RJpMAgM OpciAuHXmP2DLZMn2jNfOwLqtnT7iGralFkmfX/ycQHHp27/R9PdEQN2F5X0qVBE+Y2O 2IFyO/MXAwGRLwltHloNgeIUQx8lPfl0h/VE8kDHfVrxLRcfcddarhdPrHIZLxZeQeBj 5qz/L/Ef09uvgkjQFjcxWemEi0n+FwI+pnFNjamTAVPDvCbC5/dHmujxXtabT0tzmPuD z2HvYPrwUrR+XtaLYuyyjjZ7sB8IZTCsN/tvBV8ZxGzCZd+h0Wx2dI46+AQf7mCcMVpb 3HvQ== X-Gm-Message-State: APjAAAVnh8eHyNpBoqvRJyOkIbY8zhG6PzYkdhx9l6NQ/kBagdjV2PS6 YZEF3+wIEGjebRjq8XFhz4uwn8XvBE1fVHX3RAk= X-Google-Smtp-Source: APXvYqwDRfPM8+s7/L613TsL7BhaKaW6u8PjW9N6ftG+A0rEeI9ZUIFDZ5cda+rfl8/FdPE0PM7UIMi3YTO9kEFrbBU= X-Received: by 2002:adf:f801:: with SMTP id s1mr5779953wrp.320.1567008643626; Wed, 28 Aug 2019 09:10:43 -0700 (PDT) MIME-Version: 1.0 References: <7ddbae5c-7451-4094-8b32-19676128054b@thelounge.net> <5d6699ce.1c69fb81.e9b71.2525SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: Date: Wed, 28 Aug 2019 18:10:17 +0200 Message-ID: To: Chase Peeler Cc: Mark Randall , PHP internals Content-Type: multipart/alternative; boundary="000000000000903bf005912fa1dc" Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: arvids.godjuks@gmail.com (Arvids Godjuks) --000000000000903bf005912fa1dc Content-Type: text/plain; charset="UTF-8" Hello, as many later posters in the thread have said - a lot of notices, especially uninitialised variables, are classic technical debt. For example, I just recently fixed a bug, that did this: `$array['key'] += $cost` - the array key was not initialised. Well, turned out that in this case instead of null, it actually grabbed some garbage number out of memory and screwed up the calculations where the total was off by a few hundred euro. Previous dev did care about notices and/or warnings and god knows how long that issue was in production and how many calculations it affected before it was caught. There is also another side effect on performance. error handling in PHP is not free - it does take some significant amount of time. And the more warnings/notices like that you have, the bigger the impact. I have migrated an old code base that was riddled with notices - just fixing those improved performance by 100% without adjusting anything else. Single page load generated 3.5MB of notices and warnings. It also fixed quite a few bugs just because vars got their proper initial values. From time to time I get reminded when I go back into the crappy code how unpredictable it can be. And the point about PHP 's future. Planning should be done for at least the next 10 years and in today's environment, PHP needs a stricter mode that is just across the board. A project that I start today is by default in strict types mode, PHPStorm has 99.9% of inspections enabled, code analysers are configured and you will not be able to leave a potentially undefined variable in my codebase. git commit hook will just reject it. Frankly, today I do not care what PHP was 5 years ago and how people used it. I care what PHP is today and will be in 5 years when my app goes into production and is actively developed. I also dedicate resources in my budget to keep our software up to date and perform TLC on it. I just do not allow the business to ignore it. A lot of that TLC is done by just regular development workflow - you see crap, you take 5 minutes to fix it. A lot of the time executives don't even know we did the TLC, nor they even should - that's part of our daily responsibilities. --000000000000903bf005912fa1dc--