Using ${var} in strings is deprecated, use {$var} instead error

Created on 7 February 2024, 9 months ago
Updated 9 February 2024, 9 months ago

Problem/Motivation

Since PHP 8.2, PHP emits a deprecation notice on the following pattern the dollar sign ($) is placed at the outside of the curly braces. It can be seen in -

PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /profiles/contrib/social/modules/social_features/social_search/social_search.module on line 145

Steps to reproduce

  • Use PHP 8.2
  • Observe warnings in the terminal when using Drush or via the web interface

Proposed resolution

Use {$var} syntax instead of ${var} syntax to avoid deprecation notice.

🐛 Bug report
Status

Closed: duplicate

Version

12.1

Component

Code (back-end)

Created by

🇮🇳India hitesh-jain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024