Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102741 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81041 invoked from network); 11 Jul 2018 02:58:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2018 02:58:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=alice@librelamp.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alice@librelamp.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain librelamp.com designates 45.79.96.192 as permitted sender) X-PHP-List-Original-Sender: alice@librelamp.com X-Host-Fingerprint: 45.79.96.192 librelamp.com Received: from [45.79.96.192] ([45.79.96.192:50284] helo=librelamp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/80-15421-E32754B5 for ; Tue, 10 Jul 2018 22:58:06 -0400 Received: from localhost.localdomain (unknown [IPv6:2600:1010:b11c:1c8a:6b41:94cb:87c8:1e0c]) by librelamp.com (Postfix) with ESMTPSA id 36FA21149 for ; Wed, 11 Jul 2018 02:58:03 +0000 (UTC) To: internals@lists.php.net References: Message-ID: <6b6ef6d3-b699-1439-f9bf-acdd713191a5@librelamp.com> Date: Tue, 10 Jul 2018 19:58:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Unifying logical operators From: alice@librelamp.com (Alice Wonder) On 07/10/2018 07:20 PM, Ryan wrote: > On Tue, Jul 10, 2018 at 2:26 AM, Walter Parker wrote: > >> >> That is a matter of style, as I find $a = func() or die more clear that >> the version that uses || >> >> Not chaining stuff together is a third style. >> >> This feels like a Python PEP request. By that I mean that Python wants to >> have only one way to do any one task. Perl style is there’s more than one >> way to do it. >> >> PHP has been a mix of these styles. >> >> The big question I have is how much PHP code will break due to an enforced >> style requirement?. >> > > As I said in the OP, out of the top 30 GitHub repositories (the first page > on the API since I couldn't figure out how to get to the second), there was > only one line that would require a change (and it was copy-pasted from the > manual). Obviously there's no way to truly know how many times it's used > in non-public code, but I'll expand my GitHub search and report back some > more solid metrics. Using github may not be the most reliable method. Look at what is most popularly used in composer dependencies. For example, I know xor is used in PHP Codesniffer which while likely not often part of deployed code is very often a devel dependency. I think phpunit also uses xor and is also very popular. I use xor myself but my use is purely hobby (I have a pseudo-RNG written in PHP that can take any source of data, random or not, and pass it through a filter that makes it pass pRNG tests - showing that passing tests doesn't mean a random source is necessarily random enough for cryptography) Anyway as I believe you have already conceded, nuking xor would require many projects used a lot to have to change.