Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105502 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90176 invoked from network); 29 Apr 2019 11:03:55 -0000 Received: from unknown (HELO tbjjbihbhebb.turbo-smtp.net) (199.187.174.11) by pb1.pair.com with SMTP; 29 Apr 2019 11:03:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.net; s=turbo-smtp; x=1557129946; h=DomainKey-Signature:Received: Received:MIME-Version:References:In-Reply-To:From:Date: Message-ID:Subject:To:Cc:Content-Type; bh=Stpwnjat8yTa0nFdvr9b+s MP+ngJrvzMkCjgQsgXL5I=; b=FOS5vPiNl1+zpsPYT9X0Bci/KLvqiwLHfC0Xpp +bz6OB90TzU5sjGvN2ZeFeT+ktgKIfZCkz9vLSR9I6bj+szeZYGR3QE2MkkWwYOl k06xEX7UYlKIwMjhmlEDymwmx2+F2hM/s+1usfi12HznhMRRPsfEgZK5Oju/sXpY oNKaA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=turbo-smtp; d=php.net; h=Received:Received:X-TurboSMTP-Tracking:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version:References:In-Reply-To:From:Date:X-Gmail-Original-Message-Id:Message-ID:Subject:To:Cc:Content-Type; b=ApflcykA/WJ7s3uvhOIQtRLhQKDXURkxISbaGSgikIJ1cZt/NSBwZ+mfuUNGbi ErBfC4vWWQ+kVzd6f3oiuJr4wuEcF0DW+mImG4SsArjN8XfgVIKAhILoTy0K5f3h yI2jBPrMmbjgOBb+psGrtZw2RyKipnEiZgQMzzHT4HpyA=; Received: (qmail 25709 invoked from network); 29 Apr 2019 08:05:45 -0000 Received: X-TurboSMTP-Tracking: 4998646301 X-Gm-Message-State: APjAAAUuvgbSnI6E5OnWNEiqw2mPJ0OldZGi4aMcgSijDf4OYuwXP86q 0SQM3rK1ZU9kzeCEW6CmdOb0PaUQvlzJyAnH8uE= X-Google-Smtp-Source: APXvYqy1DoVgq2RASAr6aDz1tnckZKpfs0nL0xF/Nu++IZ1AiZm5gb3BrqZgJxJa1dGrfwE5osRNj/9LoPheCPC+EmQ= X-Received: by 2002:ac8:8ad:: with SMTP id v42mr41761481qth.337.1556525145592; Mon, 29 Apr 2019 01:05:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 29 Apr 2019 11:05:34 +0300 X-Gmail-Original-Message-Id: Message-ID: To: Nikita Popov Cc: Bob Weinand , PHP internals Content-Type: multipart/alternative; boundary="0000000000006316e00587a6c0de" Subject: Re: [PHP-DEV] [RFC] Change the precedence of the concatenation operator From: zeev@php.net (Zeev Suraski) --0000000000006316e00587a6c0de Content-Type: text/plain; charset="UTF-8" On Mon, Apr 29, 2019 at 10:55 AM Nikita Popov wrote: > On Mon, Apr 29, 2019 at 9:34 AM Zeev Suraski wrote: > > > > > > > On Thu, Apr 25, 2019 at 12:52 PM Nikita Popov > > wrote: > > > >> On Thu, Mar 28, 2019 at 2:33 PM Bob Weinand > wrote: > >> > >> > Hey, > >> > > >> > I feel like concatenation having the same precedence than addition and > >> > subtraction is promoting programmers to make mistakes. Albeit > typically > >> > easy to catch ones, it is a quality of life change at least. > >> > > >> > Hence I'm proposing a RFC changing the precedences: > >> > https://wiki.php.net/rfc/concatenation_precedence > >> > > >> > Bob > >> > > >> > >> Similarly to the ternary associativity RFC, I've analyzed the top 2000 > >> composer packages and checked whether they would be affected by this > >> change: https://gist.github.com/nikic/a4df3e8e18c795 > >> > >> > >> Zeev > >> > >> 5c2c21cf6cdb4cbfaa > >> > >> > >> The tl;dr is that there were 5 instances where behavior would change per > >> this RFC, and all 5 of them are bugs in current code and would be > >> interpreted correctly after this RFC. > > > > > > Nikita, > > > > I'm a bit worried that using this as a standard test suite may > > (repeatedly?) give us a false sense of security to go ahead with > > compatibility breaking changes. > > Composer packages, almost by definition - tend to be of higher quality > > than the 'average' PHP code (at the very least they're redistributable, > but > > arguably Composer users are more advanced than the average developer - > even > > more so those who publish packages). On top of that - probably the some > of > > the most redistributed pieces of code in the PHP space - aren't covered > by > > Composer at all (e.g. WordPress). > > > > Even if something is not published via packagist proper, it will commonly > be redistributed there. E.g. in the dataset I used, WordPress is > represented through the roots/wordpress package (a packagist mirror of > WordPress). > That's good to know - thanks! > Don't get me wrong - I think it's great to have this indicator, but unless > > I'm missing something, it's far from being something we can thoroughly > rely > > on to determine whether a certain feature is commonly used or not. A > huge > > chunk of the PHP codebase is completely invisible to us, and much of the > > code that is visible to us does not reside inside Composer. > > > > Absolutely. This only looks at a very small fraction of PHP code, though > also at a very important fraction. We do need to be carefully about where > and how the methodology is applied, for example it would make very little > sense to use this approach to analyze short tags usage -- that's clearly > something that will be predominantly found in proprietary template code, > not inside open-source libraries that have no need for templates to begin > with. > > TBH my main concern with this change is not the BC impact, but the concept > of doing precedence changes at all. This is going to be a pain for 3rd > party tooling, e.g. I'll have to add an entirely separate parser for PHP 8 > to the PHP-Parser library. Agreed on both. I hope folks factor that into account when they review the results of this tool before deciding about deprecations. Thanks, Zeev --0000000000006316e00587a6c0de--