-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
PHP 8.2 | Fix deprecated embedded variables in text strings #44538
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 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Nice job.
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.