Repository navigation
PHP 8.2 | Fix deprecated embedded variables in text strings - #44538
Conversation
PHP 8.2 will deprecate two of the four currently supported syntaxes for embedding variables in double quoted text string/heredocs.
This library contains six uses of embedded variables using braces after the dollar sign (`"${foo}"`), which is one of the deprecated forms.
This commit fixes all six.
Refs:
* https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
It’s a JavaScript syntax for variables in strings. 😃 Thank you for spotting and correcting it 👍 |
|
Does this need a port to WP Core ? Will this be handled automatically or should I open a PR to Core for this too ? |
|
I wonder if this particular PR needs porting, as Core version of the
As far as I know, this is handled by the release managers. |
|
@anton-vlasenko I have added the labels, let's see what happens... |
|
Hey 👋 I've removed the labels as this PR will not need to be ported to Core. The equivalent function in Core is already using the I wonder if in fact the GB should have the same syntax here as the Core one 🤔 . |
|
Thanks @michalczaplinski for investigating.
I imagine that would greatly improve the code readability as it reduces the length of that really long long line and makes it clear which are the variable parts. |
What?
PHP 8.2 will deprecate two of the four currently supported syntaxes for embedding variables in double quoted text string/heredocs.
This library contains six uses of embedded variables using braces after the dollar sign (
"${foo}"), which is one of the deprecated forms.This commit fixes all six.
Refs:
Why?
Because code should be cross-version compatible with all supported PHP versions, including the upcoming PHP 8.2.