Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111380 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51362 invoked from network); 8 Aug 2020 21:35:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Aug 2020 21:35:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 041A51804DA for ; Sat, 8 Aug 2020 13:34:41 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 ; Sat, 8 Aug 2020 13:34:40 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id o18so5583985eje.7 for ; Sat, 08 Aug 2020 13:34:40 -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; bh=RUrRMHhDeNBd653eck45GnYfAO22i6/CW4PxSw22rAg=; b=W3OYm5mHwt3NmXPGCBZbrA8Pstr7BR0SuzpEZKBciij2MGN1nSfqzhWp13WmyJDfmT 5R8/97d7cYVoqT7Uu7UJgB5cLPGD7H6dE/v/Ijqt86z+drjZONZyazp4Z3qZczY6vaJF cs0jdRaoScj/UibhJbbburOomd7IPgHsWaVthwhM+ydgl5GLjU7naMIS3O8bhWhmdspx AT/aMx5hdOxSQA4Y9lOkSYbQwm0+rNmEMeUeYB8ydHtyFcJ3WXxmJhdrWNtioXTjwUVk na/jx8mir7SNpsorthJ1ghL5ip5SuXdTgBD/dN6j9ac2cwbqZUyZZDDBqK3LWc2gYrQp sa7w== 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; bh=RUrRMHhDeNBd653eck45GnYfAO22i6/CW4PxSw22rAg=; b=IM4QNm+i2jpp/bYAVmlrEoygs5IetDM0N8yQTmKwlPC9OMmSgzmMEIKxt6fRl7yRqo dxWQYRskplU+js/jiZOjszpR4ZpRRtl6NA3ZkHsyAuiEiw/iWf4vcV7fzIUKzEI7nPbC ssRyU7rkqEs4HKh2C+/v7p1WepctX7RDrPKjBfb85DQbNsdnQ1C0o9wEcHKZ7nDlOzBf 6eQTPqV5V4uWTFr++hqrOiopQQe4E9DmEbE0JB48PTjIxylYHtV6wBcWWwk+DNuwnLdm LbUuTgkr0cRNOtbXrIO+xZuNR1eKH3p0GwQKB2E/iANZfCtEji9b1dAGc0ZDyvCLOlPr m1tQ== X-Gm-Message-State: AOAM5317uzPkyfY+BYxzFMnmugrlQMz+HJuVDyYFK6Xa9NiICYANyl4I lr9d2pGiceYsKkw5QM66mno4pPxIknu9FiPdpAEACEdC X-Google-Smtp-Source: ABdhPJw7UYt9D6Lu4ot8UYaSUGelwznRwdQMjPW8lpb5Hp9f3K6w5kumN5PWRZcelH2i8FLKja29knygIerOMXNnotg= X-Received: by 2002:a17:906:eceb:: with SMTP id qt11mr14641856ejb.519.1596918874572; Sat, 08 Aug 2020 13:34:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 8 Aug 2020 22:34:23 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Nikita >> > I started the vote on the nullsafe operator RFC. >> > https://wiki.php.net/rfc/nullsafe_operator > > I just noticed that while we support "$a->b", we do not support "$a?->b" (the quotes are relevant -- I'm talking about interpolated strings here). That is, in the latter case the "?->b" is just treated like a string part, not like a property access. > > I don't think the behavior for this case has been discussed and I'm not sure what the intended behavior here is. I missed that one. There's a test for var_dump("{$null?->foo}"); but not one without the braces. I would classify this as a bug and expect this to behave the same as -> (but not erroring on null obviously). Worth noting that chaining won't work as it doesn't work for -> either. Sara/Gabriel, What do you think? Should we fix this? I'm assuming this will only require a change in the grammar but I haven't checked yet. Ilija