Re: Null-safe property access in interpolated strings

From: Date: Sun, 09 Aug 2020 11:49:22 +0000
Subject: Re: Null-safe property access in interpolated strings
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-111389@lists.php.net to get a copy of this message
What are the good uses cases for this to work? On Sun, Aug 9, 2020 at 8:48 AM Marco Pivetta <ocramius@gmail.com> wrote: > On Sun, Aug 9, 2020, 00:17 Sara Golemon <pollita@php.net> 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 > > > > Ooof, people still interpolate strings that way? > > Good riddance if it doesn't work: this code is questionable (and not just > because of the question mark in it) 👍 > > > >

« previous php.internals (#111389) next »