Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107664 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45021 invoked from network); 24 Oct 2019 20:10:43 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 24 Oct 2019 20:10:43 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id D59CC2D1FBF for ; Thu, 24 Oct 2019 10:57:10 -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 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-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) (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 10:57:10 -0700 (PDT) Received: by mail-ua1-x929.google.com with SMTP id u31so7441589uah.0 for ; Thu, 24 Oct 2019 10:57:10 -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=fY/NAUP29LbpeM5xlDcFgSYgh+/HAW9H4EVbtb3mNLQ=; b=OVvOjd5iJ7HyoazePGMTUYsL6eyKlRx4LsJHQPc+y1SI2lGUrhwjJAf5ODefWRF15H HvCO0RrLuT6as2fB1r7t3+Ub2hBuNKPT0z4QM8IrjCHHTROgDHvF8Ji292Nw9NLJ5Ayy 0nJuQuyQH62OIo5bPjROKfjNnHtMI2aVDJ/of4t4BE07jv/ugbz8JnjAm3Wsej3L4tJU QJrLiyyeepZekwc6rYOLIywQMLJdPF5SMr9HpJ76aJmgtFUiX1ZbG0jcw6k+VCrHV34g 0oOVz3dQVH4M+nF3oRwmCzJLMT4B2KZYbo7Uj8i715uyrbKMHXiqiTa8ZPjtpoTEXKNX vndQ== 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=fY/NAUP29LbpeM5xlDcFgSYgh+/HAW9H4EVbtb3mNLQ=; b=lrWm0aA916erRIDceJolBqzsyTALN1te8/RaAebJMDRp6fhShlWWTF3pOHuVj+/xyR iEglqRNdZ5Xpj21E/SvGBFliPvgTygwlbeih2MKPyZ++9FkllgLDVqtUYnM/AuEJzmyS L7nHTCormShk2m55SQCO+MPWGnFlx60l9tLXM6WRU2VHjf1hRZSDkUaow9CqGEIUsZsV eAs0QrrRa9jCuWTl/vUPtChdJpBAAi4eGZ9fdexrKdv+hNzN9ZlvGNw6Y5Z5OxP8WSAn EUolVCreK903LKx30/gJvn5zHGXq8LqMv79D/J5A7HL5CYMk2yEt3x89wFhNu/JXNtvD uiaQ== X-Gm-Message-State: APjAAAX8ndD3ERP6tr9XcW7OJw7fsRZmc6dOLH7QIRPb5I0GlbtEfSSI ulA5jR1eOhSzRTpGYGcVJ4wX3PGZQuq9TAQnEiA= X-Google-Smtp-Source: APXvYqzHpcp0trm1/+QDgoPf1Aiu7ZrO7MdkQgBsEkivoHlpR2S4RnbwDI3VrAR6CdsM6+QmS8gsbyqZbaiqrLnLP2g= X-Received: by 2002:ab0:2654:: with SMTP id q20mr5881052uao.50.1571939829785; Thu, 24 Oct 2019 10:57:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 24 Oct 2019 13:56:58 -0400 Message-ID: To: Stephen Reay Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000029a8660595abc399" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] anti-coalescing-operator From: dohpaz@gmail.com (Ken Stanley) --00000000000029a8660595abc399 Content-Type: text/plain; charset="UTF-8" On Thu, Oct 24, 2019 at 1:46 PM Stephen Reay wrote: > Hi Ken, > > This sounds like an alternative approach (for solving the same basic > problem) to the nullsafe operator discussed a while back, no? > https://wiki.php.net/rfc/nullsafe_calls > > > Cheers > Stephen > Hi Stephen! Yes, it would be similar if the object you're testing against is the same object you want to call (e.g., $foo !?? $foo->getBar()). But, if the variable is not an object, or it's just a test for another object, then the nullsafe operator does not seem to address this situation (e.g., $userId !?? $bar->getUser($userId())). In fact, I could see this RFC complimenting the nullsafe operator: $userId !?? $bar->getUser($userId)?->getName(). Thank you, Ken Stanley PS. Dan, I am going to respond to your request for a code example; I am taking my time so that I can give you and everyone else a good example. :) --00000000000029a8660595abc399--