Re: Null-safe property access in interpolated strings
| From: | Marco Pivetta | Date: | Sun, 09 Aug 2020 03:47:48 +0000 |
| Subject: | Re: Null-safe property access in interpolated strings | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111386@lists.php.net to get a copy of this message | ||
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) 👍
>