Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106973 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51497 invoked from network); 12 Sep 2019 17:35:54 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 17:35:54 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 489F12D19B2 for ; Thu, 12 Sep 2019 08:11:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 12 Sep 2019 08:11:48 -0700 (PDT) Received: by mail-ua1-x92c.google.com with SMTP id w16so8110289uap.9 for ; Thu, 12 Sep 2019 08:11:48 -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=17mxizmj9KG/u+eGvdW7uf56JsaOl7XB9fqaWs2Ypnk=; b=a8ordiy+gFhWg22xrCLwQ8fjI8ontdTY0fiSSv4LcFQXPeuRWrO8JGM7Q7mLPAQt+M IC2hIbgNh6Yg7XyML5V+pq+PdNTVElNkGLTF4vRCG759dP36BgPExbPD2BqLUEa3g4xA 6Q0ywCfb9XqdG48Z0K8LdEpCRafFD8uvD5veH2YoMx7a5h70gEblhaQ8rZcbVrq1H3wW jA7f1GL2WiEZZlV2C9acrte0pGzk6iNqXA0KmuGyYtlGMWMWasmLV+LmInJP4p76k5Na SwJPFCcG0oeTJUn8k8KszD+TD8J9gICn06RMbG15QpSN6BLoqJI8eBps7By3IfU6ouqR FY0g== 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=17mxizmj9KG/u+eGvdW7uf56JsaOl7XB9fqaWs2Ypnk=; b=WsbaE4fBAzrPERTHk2TG6VgqBcZgZH77yO1Gbj3L5Jk11bqJCmfNGBFK2dpt1/EUVz Sk2CY6ZvffqLpAlBpau6CfjT7jzUIGegKfG2P5Ny0E9vMyrnbFqxcInU4ImseGQQSgCx Iv1BaekhLPzQoK5Pg0IyFpTDBgTUtgV3g5hQsFUsZho+7XEy1XfTNDgu0mWAaYqPBopK O0I9gxOBofE9/O/DH5ZLfCIZLBQpptq9RxKPaJx/hsoqUgWLdObXGBkfYJZPPqNHrlBD H/0FlbD/AeefchU6fveOcvG9oyVfWw026/EHB3ZeqyvpKxyrDUPCksljbZVC9yYkv0eN jG1w== X-Gm-Message-State: APjAAAURYpis9DLcWxoR5EaBaECXHm8kkip4zP6k8Bqei+WCil5yHcGO qnyRCF6ZFZ00ifM04e832qJNfdhcN+WeWKJA4+Bx8n0w X-Google-Smtp-Source: APXvYqwb1y+xUB4mq54bT5MzqhpJmYMzKcVOGZww3i2pIBbKhkQel05gf6rLXA32cuXAVQ5BZZTOa+lLYYj5fr9hnzs= X-Received: by 2002:ab0:6589:: with SMTP id v9mr13342202uam.34.1568301108093; Thu, 12 Sep 2019 08:11:48 -0700 (PDT) MIME-Version: 1.0 References: <076701d56978$86020910$92061b30$@php.net> <783971db-7835-3fc5-60a3-ca25c38cdc3e@seld.be> In-Reply-To: <783971db-7835-3fc5-60a3-ca25c38cdc3e@seld.be> Date: Thu, 12 Sep 2019 11:11:36 -0400 Message-ID: To: Jordi Boggiano Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000072e72505925c8e31" X-Envelope-From: Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: chasepeeler@gmail.com (Chase Peeler) --00000000000072e72505925c8e31 Content-Type: text/plain; charset="UTF-8" On Thu, Sep 12, 2019 at 11:01 AM Jordi Boggiano wrote: > On 12/09/2019 16:44, Zeev Suraski wrote: > > Similarly - adding typed variables - is certainly a future option. > Changing > > PHP to require typed variables (without opting in) - is well outside of > the > > internals@ mandate. > > > > > > > > For areas like that - our options are either doing nothing, or providing > > opt-in mechanisms to cater to stricter-loving audiences. I'm all for the > > 2nd option, but there is no 3rd. > > > While I am not sure your tone will be well received by your target > audience, I just wanted to say I tend to agree. > > My thoughts as well. > Breaking BC here does not seem to bring much. If there are cases where > enforcing strictness might allow better JIT for example, then I could > see the case being made. But simply turning working code into fatally > failing code isn't progress. > > Yes! > I know I have a bunch of old stuff running which tends to litter the > error logs with notices, and I don't have time to go fix them so I > ignore because it's fine and it works. > > Can't make that argument. Be prepared to be told how easy it should be for you to fix it, or, how it's technical debt (ignoring the fact that it's not technical debt currently, since there is nothing wrong with what was written) and you're just making things worse by not taking care of it. > For new projects, what I do, and what I am pretty sure 99% of the > "strict camp" does is essentially boiling down to: > > set_error_handler(function () { throw new \RuntimeException(); }); > > That's our global strictness flag right there. It's been available for > ages. I don't see why we need to take something away from others to make > such an easy workaround a little less needed. Especially as I don't > imagine we will drop the error handlers. I sure will keep mine around to > keep failing warnings etc as hard fatals. > > So what do we gain exactly? > > That's the argument I've been making all along. There are so many ways to accomplish what has been proposed without forcing it on those that don't want it. It's not required in order to add new features to the language. It doesn't make the language perform better, either. It's also not taking away something that is definitely a negative feature. It's taking away something that many view as a positive feature of the language. If there was no way to achieve the intended results without making the change, I might be more sympathetic to making it. But there is. Whether it's an error handler like you mentioned above, stricter code reviews, public shaming for anyone that doesn't initialize their variables, or any of the myriad of other options. > Best, > Jordi > > -- > > Jordi Boggiano > @seldaek - https://seld.be > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Chase Peeler chasepeeler@gmail.com --00000000000072e72505925c8e31--