Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107668 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85135 invoked from network); 24 Oct 2019 22:37:52 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 24 Oct 2019 22:37:52 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 5CA122D1FC8 for ; Thu, 24 Oct 2019 13:24:20 -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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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, 24 Oct 2019 13:24:19 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id s1so18716711wro.0 for ; Thu, 24 Oct 2019 13:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=Ad6x1JL9nDVCd4/lLx8dmSVXQJwM2cyUbgzWUnHs7fY=; b=CyV1YK8QdIk859l6oxHFbsZCKmLCSlJ6z+6L2bXCIOIgeUkFqCUsbbGWN38ccyMJGY t4f9Jb2LAyU3jc0Qdbct/OgWJF34H0rrqZQCcwFEWBlCDyNhxyO5scLUKNGBa22TlVby B538InGJeLWP6bmqsPGtPACHG5+k8Jt2hhXwF9M7sUCCU7Zwi0GfD7Tn5SJImGh8f4yf RYRX+LQmPbXTa8sXdZKYDQQMSdj1N8teNGSqOP+6gqYDev1R7cairDZYtC3xv2UcidJm +cmABDbiQIswcKcgIGJF0VpFRAGyAmHKOa4BIDnTde0EzNj9hxsFA4SmBk9ISlt+09Y+ 8alQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Ad6x1JL9nDVCd4/lLx8dmSVXQJwM2cyUbgzWUnHs7fY=; b=ICAL/gUoN7zV50eWRv1PF8G8GyyJEDohkeMzCKsRIv6SOtWiYQzCYSsfBUztXvqmqf qlRjKY9oBp8OsWh0vW42/ouJeH1FaRz+Cr4CU9iujbZA34XHSK5Hh25q1jitHuyR9XRL +/QKRfVO01RWPXVDqZp90yohHnxlGonnnofuS5nc/eHh2J7tuGb70BQUOq3zTapDYzhS PM9+lMV0lUmPEpmeBLqxskGnS+03xfADaq4Coa+Yv1XTpamNNteY+GcB8GBEAY4VbiJf 61vEvO44UMOqg6P039ZNhXGWsusv+37vhwObxeK1s1RTL9cF9bmzCXBgYoO2FehQTNvV 3HjA== X-Gm-Message-State: APjAAAUOzfbs9T2jsaEQt4hClTUBpiWG1uhKIGeZTq1+uD9jcdp19MoY nyxcNlvUNBgrCrR+yNFNMaZj4k/qzlc= X-Google-Smtp-Source: APXvYqyY4BHI0BEhIsmonmaRflQogx10Vxid69rvlClo/DNEerN6TATbNSBjNpp4sUFZKU/qf9DJkA== X-Received: by 2002:adf:e80b:: with SMTP id o11mr5585724wrm.231.1571948658465; Thu, 24 Oct 2019 13:24:18 -0700 (PDT) Received: from [192.168.0.16] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id l14sm11683280wrr.37.2019.10.24.13.24.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 13:24:17 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <0dcd4be8-1fd9-068c-5025-a721513ab347@gmail.com> Date: Thu, 24 Oct 2019 21:24:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] anti-coalescing-operator From: rowan.collins@gmail.com (Rowan Tommins) Hi Ken, This is definitely an interesting idea, and when described as "the opposite of ??" the !?? syntax makes sense. Looking at the example, though, the "negating" part becomes a bit confusing. The verbose form reads naturally as a positive assertion - "if this is set, do this": > if (isset($_SERVER['fname']) { > $user->setName($_SERVER['fname']); > } If we used the ?? operator, it would be a negative, "if this is not set, do this": > $_SERVER['fname'] ?? $user->unsetName(); So the short-hand form becomes a kind of double negative - "if this is not set, don't do this", or "if this is not not set, do this": > $_SERVER['fname'] !?? $user->setName($_SERVER['fname']); That makes me think that the choice of syntax isn't quite right, but I'm not sure what to suggest instead. Regards, -- Rowan Tommins (né Collins) [IMSoP]