Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106765 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69603 invoked from network); 28 Aug 2019 21:56:15 -0000 Received: from unknown (HELO mail-yw1-f45.google.com) (209.85.161.45) by pb1.pair.com with SMTP; 28 Aug 2019 21:56:15 -0000 Received: by mail-yw1-f45.google.com with SMTP id 201so213087ywo.13 for ; Wed, 28 Aug 2019 12:28:28 -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=MM31BkzSl2BcbKsOUldoMfHjpDbySeg3vogOZinOel0=; b=ZXQ7yQRPRsDizr8FFteJhj0r0aiGckYgmyCHLrgfdRWrw4u4Pwp3lftVFeLmMs31VT b3YXN4WcRl8TBOWQRQtwtlyRj8029o4W+mWctQWuOeH9SEbkGHrwZqf2ejAsSBpBumHu qbvWlJV/4CGEvrs2SFuhmnIMr/FGUKeMrxvqDhaQ8bfMJxdKbtLGnzHFr7CuNj64mz+M 5+5x24lmxZMDe3puYmjqSD7zzLkHdl3VhpVE1v1kwRmLDZBeQq31k6v/kS5+uawiQhpf Zm5qS0WA8buxN+2F0Mmx5FLMRrcOkP3HtL0Udto6J7Ps3bZ8pDcbh+mQOkC6TayV+mnP 5SjA== 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=MM31BkzSl2BcbKsOUldoMfHjpDbySeg3vogOZinOel0=; b=REOuAzeOWdVQuzqtMk/oRjMgsB+xuhi8nMFfdR3hXANQ4TN2X4gE1PJ9bHlLawr6jC 3osiUgqjXl9vywx1uFLDQSj4mU+2s5h+WwtXkT6yHVRilAvObFIat5uTUE47koBS8J2T hy+ytOwzwzb1ctHgjWnRS+67dxmG2vFwDc2BDPP2uE7MtwDIDOFQTdz0D5ptO7I2jmMC CIolzxmNIY6rAM7Wd7khGCH9A5k7TJOD9fneiS37oDmE0UNXITYhuTRm7DJyG8+t6rM5 /+mOsTFvY2/JqONGRMpLh9q+UotzUx3/VKAvuhMquhZDh6hNxbYzEPTQ2jVKQRRDKlEy U64w== X-Gm-Message-State: APjAAAXygoFJES2Sur9zHl0qOMLUwvKuzBf1AKYNm0K9mp2+Lb+nC61i T+Cp/XJsVz61M5jtVEz4i/Trl3bh7IfKDrtkXKsDeDO1 X-Google-Smtp-Source: APXvYqwgQsLZXerE405kQEYBeubRR9hk9EgIYJGkA+XT7mdT8oIS7o8qp7fzqCYkN4YWLAouXFL8a98/+/7ko8WFd0w= X-Received: by 2002:a81:9a4f:: with SMTP id r76mr4534523ywg.28.1567020508237; Wed, 28 Aug 2019 12:28:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 28 Aug 2019 15:28:16 -0400 Message-ID: To: Zeev Suraski Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000bfd36c059132648f" Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: matthewmatthew@gmail.com (Matthew Brown) --000000000000bfd36c059132648f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Javascript has treated undefined variables as a catchable exceptions since (I think?) forever. Perl is the only other language I know that allows them= . I've written code in a lot of different languages. Many of those languages (most notably Standard ML) forced me to think about how exactly data flowed through my program. PHP, on the other hand, doesn't demand anything like as much work. This means its developers often don't improve much either, which ultimately this harms the language's reputation as former PHP developers discover their bad habits don't translate well to other languages. With this change we can make it harder for people to write bad code, which I think will result in existing PHP users becoming better developers. On Wed, 28 Aug 2019 at 14:32, Zeev Suraski wrote: > > > On Wed, Aug 28, 2019 at 8:20 PM Matthew Brown > wrote: > >> We log 1 in every 1000 notices, and yes - being notice-free is a goal = =E2=80=93 >> though not one with any particular timeline at the moment, because we ca= n >> just ignore the problem. I look forward to not being able to ignore the >> problem. > > > When was this goal set? Was there effort that went into it? > > My point is this: > > In a codebase where being notice-free isn't a goal - and/or where code > patterns that rely on the documented behavior of how PHP variables are > initialized as well as behave in read scenarios (with or without the > silence operator) - I think you're going to find a lot of such instances, > probably more so than in a company that made an informed decision to not > allow it and gradually work to remove existing code that uses it. For > many, this is not considered technical debt - but rather - using the > language *as intended*. Using the language in a way that is sanctioned a= nd > considered valid - alongside other ways which are also considered valid > (e.g. a notice-free codebase). > > While I understand what you're saying when you say that you look forward > to not being able to ignore the problem, it sounds like a fairly weak > argument for forcing everyone else - many of whom don't consider this to = be > a problem at all - to change their code. Instead, if this bothers you, > make an informed decision to change - there's enough tooling to do that > today with reasonable effort. Or support the ability to flip a switch th= at > will granularly force you to fix these particular issues. Forcing all > users to work in a certain way, because some of the users who want to wor= k > that way can't bring themselves to do it - doesn't sound very sensible IM= HO. > > I was hoping that the glaring obviousness of how other languages tackled > similar issues (Perl, JS) would go a longer way. It should. > > Zeev > --000000000000bfd36c059132648f--