Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111420 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39481 invoked from network); 10 Aug 2020 11:34:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Aug 2020 11:34:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A50DB180509 for ; Mon, 10 Aug 2020 03:33:40 -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-Virus: No X-Envelope-From: Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 ; Mon, 10 Aug 2020 03:33:40 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id 185so8963661ljj.7 for ; Mon, 10 Aug 2020 03:33: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 :cc; bh=X5vZEphc8XgDizDi43Mob9CxXh9oZtdOx9g6TcpBxZk=; b=SVEHY3gLLpYXLhXK4QreLZxuy/M9TBZjGZZ9uPZxv/fn1UfybAcAwMxTdbKJjDC200 Vt6G6dd2nwJN0zdVm+zfn3/yg1Af/xNLJpLV9odFB0b9UKHvzwGiALaYqndZw/X+rJPa S21It6M2e+YpOlA9NdNgq09Js6XsWcnTlKJvuda4VMqm5HffPCWrClAoCfl9+Mnh64Y0 6cEjsWqXThP1Xrwk2pw+NE1K8XO22hi2qPbyF+GQQre0wk65n6cXY44an53209w+BgDY wCiN01O5KkZjN8HreV60hdyyuXhjmlaEUBdBlk8MZYddx2UvyMFJX5XbvcdX4Y7sPtV5 RuDw== 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=X5vZEphc8XgDizDi43Mob9CxXh9oZtdOx9g6TcpBxZk=; b=t7ZFQW1bz9V+Op3mSCExAGVzeoHU9Ft50pJ77Uc1AEmc+5py5AQO3EmiF6jKkze9Sw FMCpO2vg7NaJcsE/QxmPqAyTz1r01f58ZIWGrowtOYE5slfV+d1CzOkMD/bAEC+XMc8E /5qisWEuok1Il5X4QKVOOOqJDQAK+IS14j+ZYpTSGxQq/ncemygBaVoFAFwOGbH5v3N2 X6n723AjUSEXl/oElcIClWRIwlOvAEfJ2y7aetkV6smy9836oNmo52r4eXQuDndJpgrv xav3I5518As90nUsZx5ZP4aHu8Y3PD0eBSps1Gs+jjV79N5B+VSWDmOuYyqAVqbE9cPC KU7g== X-Gm-Message-State: AOAM533qa0q9b9FdxN/qyo2ZlxEOPuki1RV+bMXscp43zOk07WQGmz60 ZKfuy8D3685vaV8bsbYbVYUD3ukSbxNnrdcHjpRasINIDjM= X-Google-Smtp-Source: ABdhPJxE3LqDRjxSHC9HUT73QnwwjF4FLQ5zLWq5GU8LeS0/ryfWvKYgAhBsFZ88FeVhiu9D7U6I9vOH42emG8Fgizg= X-Received: by 2002:a2e:8e70:: with SMTP id t16mr227357ljk.81.1597055618558; Mon, 10 Aug 2020 03:33:38 -0700 (PDT) MIME-Version: 1.0 References: <24ce93f7-b5b2-fb63-6ea4-032c4e71f049@seld.be> In-Reply-To: <24ce93f7-b5b2-fb63-6ea4-032c4e71f049@seld.be> Date: Mon, 10 Aug 2020 12:33:22 +0200 Message-ID: To: Jordi Boggiano Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d4adf205ac837c62" Subject: Re: [PHP-DEV] Null-safe property access in interpolated strings From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d4adf205ac837c62 Content-Type: text/plain; charset="UTF-8" On Sun, Aug 9, 2020 at 8:34 PM Jordi Boggiano wrote: > On 09/08/2020 00:17, Sara Golemon wrote: > > Do we expect this to work? > > > > $foo = new stdClass; > > $foo->bar = "Hello"; > > echo "$foo?->bar world\n"; > > > > Because at the moment it doesn't: https://3v4l.org/nLv3l > > > > -Sara > > Can't say I'm big on interpolation but I'd definitely expect this to > work because why not? > > I think if it can be reasonably fixed it probably would make sense for > consistency and WTF-avoidance if anything. > > Best, > Jordi > Agree. I don't think the question of whether it is useful should come into this, it's a matter of language consistency. There could be some leeway here if we say that we have plans to deprecate the "$x->y" syntax in the future anyway and don't want to extend it anymore -- but I don't believe we have such plans at the present time. Nikita --000000000000d4adf205ac837c62--