Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111384 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63705 invoked from network); 8 Aug 2020 23:25:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Aug 2020 23:25:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4783D1804C8 for ; Sat, 8 Aug 2020 15:24:42 -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=1.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 15:24:41 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id t23so5821458ljc.3 for ; Sat, 08 Aug 2020 15:24:41 -0700 (PDT) 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=wcWAdG6WZ9eSWwUK9HP/Gsg7xWzZKTyzixvGRm/txN0=; b=XmmiCaTXm5Qwstrxt/D0wIqrW3qc2g0CfaLU4tiN/qRX7HT7Sw8E2Of1pO8dWp5feR WYarsqfeBSr/FZ/EdeO69bAdMQpnv2aepOXJHA0OLMTpNsWGHWgHOY9IHOihlzHjN736 mdCLmix3FRm2mbTmqjz1+1fsKJNVkLW6nentmTc3cDU7huf6iIFpjt41RN8jjroF60SE KUeAwkJO40dOtU9zLf5XeNGc4KEWbZdJ2RpE/ijyWa+cBkVx1fX2eSLTdtH1o3U+u4zr DzHobVSw/DUXPNEmb3mDAXMHihdLvPa2IsY88tq/IJUlxcen1OnBLUX+0Rj5L97n/wr6 srUA== X-Gm-Message-State: AOAM531wl89202QqErGY8PnnAPwzAH365tq1xFD4NBpkX+OK3iDS9Otg l5VZf4DTG84bU8EFEG4+gzG4mGlL/7tgm6w28m1RIg== X-Google-Smtp-Source: ABdhPJwWwAGtrv3XqtUReVwqmrAdkYyWVq38/4lYCBNGATrvLps+jmKQAJKFbi//ZcBtlh4rg8EV9B3+Gr1lhOhNYqI= X-Received: by 2002:a2e:7c05:: with SMTP id x5mr8466319ljc.451.1596925480127; Sat, 08 Aug 2020 15:24:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 8 Aug 2020 17:24:29 -0500 Message-ID: To: Ilija Tovilo Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000f9e5ce05ac652f04" Subject: Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC From: pollita@php.net (Sara Golemon) --000000000000f9e5ce05ac652f04 Content-Type: text/plain; charset="UTF-8" On Sat, Aug 8, 2020 at 3:42 PM Ilija Tovilo wrote: > > > 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. > > Hah! And just as I sent my previous message, I noticed you started THIS thread before asking me about it elsewhere. Circles.... Anyway, IMO this comes under bugfix. By all means fix it up. :D -Sara --000000000000f9e5ce05ac652f04--