Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107001 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21730 invoked from network); 12 Sep 2019 20:38:48 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 20:38:48 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 7C31B2CAEF4 for ; Thu, 12 Sep 2019 11:14:45 -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-vs1-xe29.google.com (mail-vs1-xe29.google.com [IPv6:2607:f8b0:4864:20::e29]) (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 11:14:44 -0700 (PDT) Received: by mail-vs1-xe29.google.com with SMTP id u21so16814445vsl.10 for ; Thu, 12 Sep 2019 11:14: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=CAWNIjv0h+tqM/w3kreTb3XWsqx3MrbPlMYhb39aVuc=; b=sBcYh4WAlMxlCev5MBMpvpVS5HueypI/dAsWzOU9WJMPUPG8Nv2jEKw7R2kWPatxqR q5s0j4uQd66BdIvaQ/ROtyrT3XccVNwkNvVG6Phxzu8ZzT/reWvua/Fa9EjlSal0aMMu d6eeg7aQD0M5pHq61hn2Tq8wPQFrizjxIWrz4fN7HefiARckChHSdkBIot/o0I8/OjDd EzPWOezgbTpvrlKAU3FN5tUyo2HGcL9f7JKPOQouicUTl9DieV9mlGLqAqwj8jCG57A7 6oIRww1dbRm7S3q0fIAQatDB8OSS+Js0YQND5cetjV5gPz3VWBA77lPmgWP4H39aI4jJ os2w== 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=CAWNIjv0h+tqM/w3kreTb3XWsqx3MrbPlMYhb39aVuc=; b=fwgBmRfjsB35TffX1V0v4m9nRJXSzKFSrM2p0JUPmdHTWdD7L32NDg2idUeW9oVb8/ G74mY+8+HemyoXSQf0wcVG2FIF4CiA71JGa4h9vIz/Jcq/AIz3GAmcKy8DimP6Z19WI6 c9C0NNxTcNMfIW0MtOSg8BhEEDfjfN7XkU0S9MRclUmwzkjkGlygprMXs/nmkzrowZzu mwbOzHxmqtjLbQ9kpYf6v6EojI/NtKZDPbxLf8eMJy0QkQgyWzSpzDfwQ4cKEhanb7Cd YPFyDBO4WVNMN9wHHYXWe1O9NHhrcAtiDVPdTtVexVAWkg4CjTNbeuADhON+AgC5iVbT RXKA== X-Gm-Message-State: APjAAAXGOrhRh2+KMfIVLJaobR6pCdcaGZ/lc00BSPIi6kb3cwnQK0zI khFwGNKDeC0u6r7/mk3e2M+Nir0EWd4ZRcNOmvY= X-Google-Smtp-Source: APXvYqwJqTQNporM8rmlu4W0dUQK5bjtZS8MIf0yy0/D6F7whIEP9Uk5xmGvRZ76DGDYB1aqFWiQ8I/TXHMbPXi5wns= X-Received: by 2002:a67:f895:: with SMTP id h21mr22069043vso.74.1568312084012; Thu, 12 Sep 2019 11:14:44 -0700 (PDT) MIME-Version: 1.0 References: <076701d56978$86020910$92061b30$@php.net> <078e01d5697c$5512bc10$ff383430$@php.net> <31BD63BC-ACE0-4478-B241-E698D2D6F59C@newclarity.net> In-Reply-To: Date: Thu, 12 Sep 2019 14:14:32 -0400 Message-ID: To: Lynn Cc: Mike Schinkel , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000aa272305925f1c8c" X-Envelope-From: Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: chasepeeler@gmail.com (Chase Peeler) --000000000000aa272305925f1c8c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 12, 2019 at 2:10 PM Lynn wrote: > On Thu, Sep 12, 2019 at 7:59 PM Mike Schinkel wrote= : > > > > > > > Just a few weeks ago I was refactoring some particularly horrible code > > developed by previously employed developers =E2=80=94 a code based that= has a > 1400 > > line function and many other functions 100s of lines long, and I added > some > > initialization for variable and array elements prior to their use. > > > > Unfortunately my changes broke the code because the original developer > > using isset($var) as branching criteria. After finding this bug, I > > realized that this code base uses that technique frequently. I am know > > from lots of experience that this is a common technical among WordPress > > plugins. > > > > > The bug is not that you initialized the variable, it's that you initializ= ed > it with a different value: https://3v4l.org/8mB8B > ``` > var_dump(isset($a)); > $a =3D null; > var_dump(isset($a)); > > // gives > bool(false) > bool(false) > ``` > > Whenever one of these errors will occur, you can initialize either the > array key or variable with null and it will work again without changing > behavior. If anything, Wordpress shouldn't be an argument to not improve > PHP, though I think it's important to consider the impact of a change, > including for the Wordpress community. However, I think most people agree > that the quality of Wordpress code and Plugins is highly debatable. I don= 't > like the idea of not being able to progress because Wordpress users won't > upgrade PHP. > > It's not a matter of won't upgrade, but that they can't upgrade. If Wordpress decides to take their time supporting PHP 8, wordpress users won't have any option but to wait on upgrading. > Regards, > Lynn van der Berg > --=20 Chase Peeler chasepeeler@gmail.com --000000000000aa272305925f1c8c--