Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102744 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94591 invoked from network); 11 Jul 2018 07:31:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2018 07:31:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 74.125.82.67 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 74.125.82.67 mail-wm0-f67.google.com Received: from [74.125.82.67] ([74.125.82.67:51173] helo=mail-wm0-f67.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/F1-15421-952B54B5 for ; Wed, 11 Jul 2018 03:31:39 -0400 Received: by mail-wm0-f67.google.com with SMTP id v25-v6so1381690wmc.0 for ; Wed, 11 Jul 2018 00:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7lUbAwzdg1/H6bRPIipUVLqbjjmdiqtXRdy3JXxQNpc=; b=dPtLcqK7eEZVN2w9IVQJOdC1MX5AVjX4RiGL0HydpcoZDwC2EuhbwL6RDJKuBR7VfJ kPsHQ4vKU4FoRXk1jjYcobZ6A40G1tX4lg4xYLFXBEUl6T5e7QSxyHfoFtBmBrzD3GdI uf71olvj8DAgmpg/RC/ONcsErUoB/kncUbS54= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7lUbAwzdg1/H6bRPIipUVLqbjjmdiqtXRdy3JXxQNpc=; b=gEdqChepzk8BDWRte4aXJ0H+TMncuIrh7xWc97Z5XEEB+B0N7pwYrG4RL0vd0EY4uc msQdGrMRh1xqECGY8NqAOumrSrbOs3E3NUwfPXOY9ii/+jp6UMWU+qRiB5GIJYxiHCfR /Mer0t8q8251Qj3UhGtoNy4nyH1j+FsOm+ofuHc52E6KlCrMefyi25prR6yivVGfG8bj c0Qm1hzPvmdCViTd+8uynlqiNrf5pTFUDlSzx9wuDzdApu+k5ToCBczXN5WQPy07Qh1c 6/q2Ok0U/1TuqWChhRNcyWz7Skz6FyxaprGP36yixN7VdkzwyEv6fAyceraeOoveJCdC B+2Q== X-Gm-Message-State: APt69E1pnZSEypffdZRgmz5sLmCU88cF6uHjllO8fny2ZvNIb2gir8M5 JZmZtaSmQQ8Ye9mTHzsUU7paxKtGetLtKgxefmdH4A== X-Google-Smtp-Source: AAOMgpfSeHqozQ/OXYqJ5Z8jUvFC15h8NNfreeW9N43L+VaAV7wWi5dqrUI3npFpHG+zP6n8Faf2Pwt6iGVfFsNrKCQ= X-Received: by 2002:a1c:1983:: with SMTP id 125-v6mr17590765wmz.79.1531294294516; Wed, 11 Jul 2018 00:31:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9f13:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 00:31:34 -0700 (PDT) In-Reply-To: References: Date: Wed, 11 Jul 2018 10:31:34 +0300 Message-ID: To: Ryan Cc: Michael Morris , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Unifying logical operators From: narf@devilix.net (Andrey Andreev) Hi, On Wed, Jul 11, 2018 at 5:20 AM, Ryan wrote: > On Tue, Jul 10, 2018 at 2:58 PM, Andrey Andreev wrote: > >> isset($foo) OR $foo = 'bar'; (and similar variations using empty() >> and/or &&) is another pattern I use often to set fallback values for >> empty or missing inputs. >> >> An eventual deprecation would make literally all of my code output >> entire screens of warnings. >> > > $foo=$foo??"bar"; would work there. I could definitely see this being an > issue if you weren't using isset (although a concrete example of that > doesn't come to mind right away). > I'm very well aware of the alternatives, that's not the point. I and although not a majority, many others too would have to go and replace countless instances of OR usage, for no reason other than "it can be done another way". Aside from a few people asking what the difference is, in more than a decade with PHP, I've never seen a single person who's had a problem with the operators you want to deprecate. They're not a common cause for bugs even by a long shot, nor a common annoyance, so I fail to see the benefits of your proposal. Cheers, Andrey.