PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead.

Created on 13 September 2023, over 1 year 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 couple of places:

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/contrib/smart_ip/smart_ip.module on line 132.

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/contrib/smart_ip/smart_ip.module on line 148

Steps to reproduce

1. Use a Drupal 10 project with PHP 8.2
1. Add drupal/smart_ip module via composer.
3. 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

Active

Version

5.0

Component

Code

Created by

🇮🇳India suraj_vantagode

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

Comments & Activities

Production build 0.71.5 2024