Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110345 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13540 invoked from network); 3 Jun 2020 11:20:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jun 2020 11:20:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6CEBA1804F4 for ; Wed, 3 Jun 2020 03:02:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 3 Jun 2020 03:02:36 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id x27so919398lfg.9 for ; Wed, 03 Jun 2020 03:02:36 -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=C24mBHJ8IA9u7VH+XmzetxqPKkzbmhwQHUEMuyLaWis=; b=YdaKkDZg0qGESxzGKOSZ7JWp9iJL/MoyYwJM3xiK0oePaxzKG+nGjrLe0qvKJRAkLC NDsgU49f0Q7wJ1wmC3V+Yw+AfzVgPX/f/LIhnwD0RPFz/Bc/hc9Nv5AOWdP49Qv/oWfX MHlLg8yRRgbA3PpqMiBITT+Qnj0PfEXrLVcj+3IF39vuaZ4SnQ6apunZlo9Zdt45/K3v QHQcIOWNXLPArdE6cgO/whJjY6MSuXNk1gwTRTAGn7DGmkEnRTAdY2ABH4qwwrATWzBl JF2S6niiK3/Zl7uVWkwBfuxfxn/TKnDafkWA4/frPYUpHQI9SEIyw84H9BIMxy5DgyaS Ok2Q== 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=C24mBHJ8IA9u7VH+XmzetxqPKkzbmhwQHUEMuyLaWis=; b=LP+OU3c+Y6hSRg4EfC2ihetflW/D4oALlxcwtVXvfPUpav75rX6X2xEJOmLdtvoYr4 ZFmEvBfuEg2XHOPQP+iPNuY5ePnaDW7/kh9UdTqBNyyH7yfbcGc8z4KJ3XsySHvAuGJt rdnr4MKcHGHX0Kk705opxYSTCf11teUL1UDRWg559IcRZVcJZZHugzLhCbJxBG8Nt144 qxUXIyBDQkjlSpr97LNgo23/s4hGHYFZyo+QfDA5TtIjvOdSaH1BJ4sD0apTwRRymPsB Szmo9UKplEdXM+GsGEKQRMixiXy/lDIvHEjg2mkxKk4lO5Ta8RJ602emGh8DBZ5hB38G sqJA== X-Gm-Message-State: AOAM533AsP2N+LF53OgxgEQl5MU+YHXINOH8dQdGiZ02odgcTRHuVjgp EkZLUi/ut8d2NogzVioby8B5votIStCleqLNDbc= X-Google-Smtp-Source: ABdhPJyC+dVOnd1LshqTDkdhU25q8z4bGJgYkHOn+N9OhUJqU9c6xtYh0+wromkz+CpD0Qk4n6Bjc4FyE777tXMHltY= X-Received: by 2002:a19:642:: with SMTP id 63mr2060405lfg.173.1591178553998; Wed, 03 Jun 2020 03:02:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 3 Jun 2020 12:02:18 +0200 Message-ID: To: Ilija Tovilo Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007c3ffc05a72b2021" Subject: Re: [PHP-DEV] [RFC] Nullsafe operator From: nikita.ppv@gmail.com (Nikita Popov) --0000000000007c3ffc05a72b2021 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 2, 2020 at 10:53 PM Ilija Tovilo wrote: > Hi internals > > I'd like to introduce another RFC I've been working on: > https://wiki.php.net/rfc/nullsafe_operator > > It introduces the nullsafe operator ?-> that skips null values when > calling functions and fetching properties. In contrast to the last few > attempts this RFC includes full short circuiting. > > Let me know what you think. > The semantics look reasonable to me, but I'd recommend including some discussion on the rationale behind the short-circuiting behavior in the RFC. That is, what the options are, and why this is the best option (which is not the option that the previous RFC on this topic picked). It would also be nice to cross-reference semantics of ?-> in other languages that have it, to make sure we don't introduce any unexpected WTFs for people switching between languages. I *think* the specified behavior is consistent with what everyone else does, but I haven't checked to be sure. Regards, Nikita --0000000000007c3ffc05a72b2021--