Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid using ${string} interpolation #80

Closed
krzysztofrewak opened this issue Sep 19, 2022 · 0 comments · Fixed by #82
Closed

Forbid using ${string} interpolation #80

krzysztofrewak opened this issue Sep 19, 2022 · 0 comments · Fixed by #82
Labels
enhancement New feature or request

Comments

@krzysztofrewak
Copy link
Member

krzysztofrewak commented Sep 19, 2022

PHP has several ways of embedding variables in strings. One of PHP 8.2 RFCs deprecates two ways of doing so, since they are rarely used, and often lead to confusion:

"Hello ${world}";
Deprecated: Using ${} in strings is deprecated
"Hello ${(world)}";
Deprecated: Using ${} (variable variables) in strings is deprecated

To be clear: the two popular ways of string interpolation still work:

"Hello {$world}";
"Hello $world";

It looks that simple_to_complex_string_variable should fix this problem: https://mlocati.github.io/php-cs-fixer-configurator/#version:3.8|fixer:simple_to_complex_string_variable

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant