Hi everyone

It was pointed out to me that unfortunately the "Deprecate ${} string
interpolation" RFC didn't specify *how* the feature would be removed
in PHP 9.

https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
https://github.com/php/php-src/issues/8501

There are two approaches:

* Completely remove the syntax and make "${}" result in the literal string "${}"
* Keep the syntax in the parser but throw an error

It's pretty clear to me that the latter is preferable for two reasons:

1. People upgrading directly from <=PHP 8.1 to PHP 9.0 or people who
have not addressed the deprecations will still get an appropriate
compile-time error message instead of their code suddenly behaving
differently.
2. We can reuse the syntax at some point without causing another BC break.

The only advantage of the former approach I can think of is easier (or
rather no) escaping of ${} in strings but this could also be a
drawback considering that it would become unclear what the original
intent of the code was (literal output or string interpolation).

So unless there are concerns I will amend that in the RFC.

Regards,
Ilija

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

Reply via email to