On 11/03/2022 17:13, Ilija Tovilo wrote:
https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation


Hi Ilija,

Thanks for progressing with this, and making a clear case why these syntaxes are confusing and redundant.

I presume the intent here is that the engine will generate an E_DEPRECATED each time such a string is encountered. Do you know yet if that will be easy to implement? I think some simple string handling is built into the parser, so there may not be a single code path to look at.

The other question which I'm sure lots of users will have when they see the deprecation is: How easy is it to adapt usages of the deprecated syntax to use the non-deprecated variants? I'm guessing it's not as simple as moving the $ sign, because as you point out the syntaxes have different semantics; is there a general rule that users and/or tools can use to generate correct replacements?

A final thought is that I seem to remember a previous thread (from Nikita?) about the "$foo[bar]" syntax, which is also confusing. Maybe we should consider deprecating that at the same time?

Overall, I'm definitely in favour of this simplification.

Regards,

--
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to