Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107000 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20257 invoked from network); 12 Sep 2019 20:37:45 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 20:37:45 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 8553D2D1FD1 for ; Thu, 12 Sep 2019 11:13:42 -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-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (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:13:42 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id c10so26959925otd.9 for ; Thu, 12 Sep 2019 11:13:42 -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=4QTGumpqyJErqgaPQwOkyM4EO9i0aj5PuVRHO0QAwt8=; b=o6oA5WjocWve/6Kp/0DQbu/rofgFScdeuI71j7QoMQYdBZA3b8/2hX4xO18Ne/robr oMXBei+dNnNM9KMa+hMbkmZ9Dwk9fbTwb9SXFN1BQx45deZFciAHAp4MXhKAGRqLMavo /h1Ff81nXxp2C+nktwcFYWZbTO4MJ3cFIqcnWxBztXPT6TCGTu0gWix05hLXTrJj8Mqo LYr05Jt7jR+c3n39i3LWx0JF05mZF1BuASi1BHUy3MjFd0u7ekK8XskS5EyF00g0ebvj S6bopI8dneCfLVVwnRZvE8nqB4BWYUTQu1eM8QPagIkgtnq6RhaAzJd7himxsJS+s8LJ BUXw== 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=4QTGumpqyJErqgaPQwOkyM4EO9i0aj5PuVRHO0QAwt8=; b=I79c1uquwg8T9VEU+d+NVBPTR/toBZiSHgLQarg8iSraHDL1kfFolAmY4FYwxe/87/ sxfKMnE+EV92vZJ7dV7IbH0PfSiIj/f9+wNquWu4mQYIiYvdVUfviLCRG8mzPEzy1Abf WGhQvfUg22c+yxV18+48bxDPB28RxZQJdh4lxJZ4gpda6USeQLImnUzSSswAfLk/cQrn 5iljP7o0cT9Lev+xQgTIUNL5yBFoETVjEb2agVVuOKs7KF6PoWfEMvLKv+zxE6vtJKUC mE0G1SyJgCxz3/U63w8OL4urGjZQi+w6JwmNe4tpJKnt8+YWkFtEldzmlcxdqAFxGOmY n+Mg== X-Gm-Message-State: APjAAAVvJBD02oO+qzsP9Yj+6Q3flQhKRfolRwcMLDkotUnMkxHwf6cc 2gLjrww8AZJt0szO4mA7q7JS4p8iUmoogCmXoO4= X-Google-Smtp-Source: APXvYqw4ALkQnrBwuUB4VnKMK3/u6tkYa6rTOBuSf+FEPoQTSZyokj6VM4t9lYORyDd9K6v77zpTGmtGXnEYjpOZgsk= X-Received: by 2002:a9d:148:: with SMTP id 66mr7595454otu.1.1568312021474; Thu, 12 Sep 2019 11:13:41 -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 19:13:24 +0100 Message-ID: To: Lynn Cc: Mike Schinkel , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000efe0a805925f1807" X-Envelope-From: Subject: Re: [PHP-DEV] Changing fundamental language behaviors From: oludonsexy@gmail.com (Olumide Samson) --000000000000efe0a805925f1807 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 12, 2019 at 7: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. > > even without a statistics to back the word is plainfully meaningless... I guess we tend to use the word "HUGELY","NEVER","EVER","COMPANY", etc wrongly on the list just to prove some points. And, we're better off than that IMO... > Regards, > Lynn van der Berg > --000000000000efe0a805925f1807--