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

Created on 9 October 2023, over 1 year ago
Updated 18 March 2024, 12 months ago

Problem/Motivation

Since PHP 8.2, PHP emits a deprecation notice on the following pattern that the dollar sign ($) is placed at the outside of the curly braces. It can be seen in several places:
PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/docroot/modules/contrib/paragraphs_sets_plugins/src/PluginManager.php on line 37

Steps to reproduce

1. Use a Drupal 10 project with PHP 8.2
1. Add drupal/gutenberg 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.

💬 Support request
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India arunkumark Coimbatore

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024