Php 8.2 error: PHP Deprecated: Using ${var} in strings is deprecated, use {$var}

Created on 29 January 2024, 11 months ago
Updated 1 March 2024, 10 months ago

Problem/Motivation

When running php 8.2, you run into these deprecation errors when checking php version:

https://php.watch/versions/8.2/$%7Bvar%7D-string-interpolation-deprecated

kristens-mbp:quantdrupal101 kristenpol$ ddev php -v
PHP 8.2.9 (cli) (built: Aug 29 2023 10:48:25) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.9, Copyright (c), by Zend Technologies
kristens-mbp:quantdrupal101 kristenpol$ ddcr
PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/contrib/quantcdn/modules/quant_search/src/Controller/Search.php on line 259

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/contrib/quantcdn/modules/quant_search/src/Controller/Search.php on line 259

Steps to reproduce

  • Install/configure Drupal 10.1 on php 8.2
  • Install/configure quant_api
  • Check the php version via command line, e.g. php -v
  • Results: Deprecation errors shown above
  • Expected results: No deprecation errors shown

Proposed resolution

Fix the deprecations.

Remaining tasks

  • Update code
  • Review and test
  • Commit :)

User interface changes

No deprecation errors in the command line or logs.

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States Kristen Pol Santa Cruz, CA, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024