PHP deprecation error with PHP 8.3.1

Created on 25 June 2024, 6 months ago
Updated 6 July 2024, 6 months ago

Using PHP 8.3.1 locally for development, I am seeing the following error message reported by Lazy...

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in ...\modules\contrib\lazy\lazy.install on line 206

My system

Drupal 10.3.0
Apache/2.4.33 (Win64) OpenSSL/1.0.2u mod_fcgid/2.3.9 PHP/8.3.1
PHP 8.3.1, memory limit: 256M
MySQL 5.7.24
PHP Caching module: OpCache

Front end theme 
A custom subtheme Bootstrap5 (Bootstrap5 3.0.10)
🐛 Bug report
Status

Closed: duplicate

Version

3.12

Component

Code

Created by

🇬🇧United Kingdom SirClickALot Somerset

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

Comments & Activities

  • Issue created by @SirClickALot
  • Assigned to abhishek_virasat
  • Issue was unassigned.
  • Status changed to Needs review 6 months ago
  • Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update 6 months ago
    Waiting for branch to pass
  • 🇮🇳India abhishek_virasat

    @SirClickalot, I have fixed the issue and created Patch file, please review it once.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: php8.3_mysql8
    last update 6 months ago
    Patch Failed to Apply
  • 🇬🇧United Kingdom SirClickALot Somerset

    I confirm that the patch in #3 solves the issue.

    Thank you @abhishek_gupta1

  • 🇬🇧United Kingdom SirClickALot Somerset

    HOWEVER, after performing (an unconnected with this issue drush updatedb) I have also noticed the following additional offending lines too...

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in <my-site>\modules\contrib\lazy\src\Form\LazyForm.php on line 161
    
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in <my-site>\modules\contrib\lazy\src\Form\LazyForm.php on line 166
    
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in <my-site>\modules\contrib\lazy\src\Form\LazyForm.php on line 167
    
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in <my-site>\public_html\modules\contrib\lazy\src\Form\LazyForm.php on line 170
  • 🇺🇸United States aaronpinero

    I am also seeing deprecation warnings on other line numbers:

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

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 216
    PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 304

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 304
    PHP Deprecated: Using ${expr} (variable variables) in strings is deprecated, use {${expr}} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 304

    Deprecated: Using ${expr} (variable variables) in strings is deprecated, use {${expr}} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 304
    PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 305

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 305
    PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 312

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 312
    PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 314

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

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/composer/lazy/lazy.module on line 314

  • 🇺🇸United States aaronpinero

    I created the attached patch against 8.x-3.12 to resolve all the deprecation errors in my case...

  • 🇦🇷Argentina darktek

    #7 worked like a charm!

  • Status changed to Closed: duplicate 6 months ago
  • 🇩🇰Denmark osman Copenhagen

    Thanks, but this issue was addressed in the dev branch about 10 months ago. I created a release of it today. Please try 8.x-3.13

Production build 0.71.5 2024