Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111382 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54690 invoked from network); 8 Aug 2020 21:44:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Aug 2020 21:44:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 89606180511 for ; Sat, 8 Aug 2020 13:42:49 -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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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:42:49 -0700 (PDT) Received: by mail-ed1-f52.google.com with SMTP id bs17so3714996edb.1 for ; Sat, 08 Aug 2020 13:42:49 -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=GGGWtDbc5esqmmjQ6jgMfALi8IaftSo5KavL02+/bxI=; b=e4NRmqzpuEiykDqpMre3TlKRqRgmcr87GSbZzZKixBcm/BpxfBWWdOR17wNgnYcDG1 QIX0kzjAJFCixEPd3uXpBE5n2zvmDXa8naslNhZHODRXnwnxImowNw7ymeOLHk3LG5Dw YN489piuL+CF7nksEWuu0gLnl7e2Ay6oxg5aYh/PmgevxZ6yspXx0PO4a4W7g/xU1Qr5 XUBGbPV95GXTu+pGlp54I4rRtXWgnvDzPcTqSRz4Cb7Ps9Zq9iudqlBwB7RgGHBXfVBj iBmR7E2fIuI0n5KTleKNi8w11wnAt57VQQI6N5/FV2Ux5HPIe+47W69G7MFSPKX/qZUh DyAQ== 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=GGGWtDbc5esqmmjQ6jgMfALi8IaftSo5KavL02+/bxI=; b=LHNUJJYXlVec/gE9kEZGpXsoKmbbUHyes+GLqUSBK+zASkZLh+YjWW8ojsuFpFslYV 3VUBsjDHtKiPnEkyTLOSY4klxhOnv0C+FOOBXCtWG8c2UEF3ljRoKQEO5b/BHuHYbt3K TKv41W0jU36pVLdBkGddmHsEvjKUWf4eCdWRG090YgBLNnhohsf89kGjo5N3HiNnhFXC m3yGycEsXXa1WyzZUPXtWk4EhaSZx4LsFxIUccbXw6YiAXCCAg5LD5upv4d3o3/ml86S PFUtZbtr53fFwZc1PVTNh3LYWGm2iolIDokNLkL2t/2U6llxT+FO28enrs9W8ffKOSS/ NWEw== X-Gm-Message-State: AOAM5320Wjksn05tSWftcr9HXGot5yMd744AydovgXJ5QWenzKeOyl8W lpKpUXgBjfR/iFbEGxRMX3s6x2bpvvErWp3APTvfECDr X-Google-Smtp-Source: ABdhPJwDjmCs9vQUs9zAayjgAKv71UvtuYA6F1UEubwji4OI70dN3Tu2Ot0Yh9hSuOlQu1+ZCV3SHs1LyGxbfPs6RwY= X-Received: by 2002:aa7:cd07:: with SMTP id b7mr15248929edw.172.1596919367677; Sat, 08 Aug 2020 13:42:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 8 Aug 2020 22:42:36 +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 again > > 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. Just as I sent this I realized this is technically a breaking change, probably a small one but still worth mentioning. I'm now also not totally sure if we should change it at this point. Let me know what you think. Ilija