Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106987 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96802 invoked from network); 12 Sep 2019 20:01:41 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 20:01:41 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 24EF92D1FE1 for ; Thu, 12 Sep 2019 10:37:38 -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 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-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 10:37:37 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id h144so56660071iof.7 for ; Thu, 12 Sep 2019 10:37:37 -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=6E7tO4j/lcoAXvHaRLy2I3x/rsblm+V9PzcSAoKgi/c=; b=GP6ZwMDCss6bZEb6ULXUtHr0pgrKc54hMJuk+3YOOiDVmCOgGeUzHWmLuY3v+StOoN LZrWVpvzqPbGtULOdHyFMZ/oed9pwlpfxg27IgjPW/ZJPtucwIAHJin2v5igzHAxhJiO z6qrXOilP47WofQTRYHdQ9av8C6iSxConNoNbkIa741aZWX/N7e7yy26WTFBu3didQyZ SANgEShx0am8SiNI6ZDfLkl/q/BwtxszzYIJ4KrfrWnJPaal6bcuKWAwuahE367tRuLY hJ+Or38fKgb47Ef9sFkyruIv0v6bcGbJQgzYxoegicelIQtIZDe2Sf9WrcwN221ilC++ fnwA== 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=6E7tO4j/lcoAXvHaRLy2I3x/rsblm+V9PzcSAoKgi/c=; b=TUpvqBOJ8kKGrqZsYlwhwMYXitHOye10h6uwiTleeR/K2GiS5uRNnsIdr64wIm8YsU oLPFUbpXtrmawufW7Mymu3Rt+w8zgT2Aq6MABjt1omWstT4TL0yErdC6FgnfBtMCmiA+ mkSRD62KL+cMFL+rXGEJTH5dixaSgYv+qnLNNEj7U2pRga6Gg4zJ3mhSnVeFN6BEzL4l gHiq/hpaCHguRUdiRsJhr7bWHAsOcOWkn/TOELztYRCZUljBe8+iIrMbnW1x7jsrsnxN 0iq5ThcHbPZTGCJSe9nPVyA+yFXgBhdD5Y+L5Vn826bJr0VAGmza5nSZDHZkCh8RxO2D U1Gg== X-Gm-Message-State: APjAAAUNzOka6jr4MjJmTmn3VyCvgqtNnT+o5XnO8nZH7sEnb7o+p4Yf MlL75YHyT/7rYkN5rkG+xZ1ugH2Up1hiyjZKy4Q= X-Google-Smtp-Source: APXvYqztD+z0oEP2uyCq4F6cbVI+VNvLCDOuGrHMh7z31IiCR5iVCSzI89taSGtsUCFZeU8KWqii16cre0KBbmquqW4= X-Received: by 2002:a05:6638:d9:: with SMTP id w25mr1895064jao.69.1568309856773; Thu, 12 Sep 2019 10:37:36 -0700 (PDT) MIME-Version: 1.0 References: <076701d56978$86020910$92061b30$@php.net> <078e01d5697c$5512bc10$ff383430$@php.net> In-Reply-To: Date: Thu, 12 Sep 2019 19:37:11 +0200 Message-ID: To: Chase Peeler Cc: Matthew Brown , Scott Arciszewski , Zeev Suraski , Marco Pivetta , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000e92fd105925e9783" X-Envelope-From: Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: kjarli@gmail.com (Lynn) --000000000000e92fd105925e9783 Content-Type: text/plain; charset="UTF-8" On Thu, Sep 12, 2019 at 7:22 PM Chase Peeler wrote: > There are valid reasons for not always initializing variables or array > keys. It might be a bad > reason in your opinion, but others view it as perfectly acceptable. > I recently had to fix a bug where a variable was renamed, caused a merge conflict and resulted in months long of changing a business process with a subtle bug, as null was not the intended initialized value. Whether or not people should initialize variables is debatable from a programming perspective. From a reader's perspective it's really important to have variables initialized with a default value, even if it's just null, to prevent missing certain assignment branches and avoid bugs. From my perspective, this should've thrown an error, so we would've fixed it the same day. Now PHP simply broke our business process for months. Yes, we hide notices, even in production as our logging server would die within a minute if we'd turn it on. Yes, this is a massive legacy code base where lots of tests are lacking. Can we change this? Sure, will take years though. Would we have benefited from PHP throwing an error in this case? Most certainly, would've saved us a lot of headache, and money. You argue that it's a fundamental language change, I -and seemingly a lot of others- argue that this is more of a bug fix. Regards, Lynn van der Berg --000000000000e92fd105925e9783--