Re: Null-safe property access in interpolated strings
| From: | Jordi Boggiano | Date: | Sun, 09 Aug 2020 18:34:24 +0000 |
| Subject: | Re: Null-safe property access in interpolated strings | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111399@lists.php.net to get a copy of this message | ||
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 -SaraCan'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 -- Jordi Boggiano @seldaek - https://seld.be