Skip to content

PHP 8.4 Deprecation: ${var} string interpolation syntax needs to be updated to {$var} #22

Description

@connecteev

Hello! I'm using ta-tikoma/phpunit-architecture-test version 0.8.5 and encountering a deprecation warning when running tests:

Using ${var} in strings is deprecated, use {$var} instead // vendor/ta-tikoma/phpun…

Context:
PHP Version: 8.4
Package Version: 0.8.5
This deprecation was introduced in PHP 8.2 and will become a fatal error in PHP 9.0

Issue:
The old string interpolation syntax "${var}" is deprecated and should be changed to "{$var}" throughout the codebase.
Example of what needs to be changed:
php// ❌ Deprecated (PHP 8.2+)
$message = "Value: ${variable}";

// ✅ Correct
$message = "Value: {$variable}";

Impact:
This causes deprecation warnings in test output and will break when PHP 9.0 is released.

Test Code:

    // Broad namespace test
    it('confirms die, dd, dump not used in App namespace')
        ->arch()
        ->expect('App')
        ->not->toUse(['die', 'dd', 'dump']);

Error:
Image

Request:
Could you please update all instances of ${var} to {$var} in the package? This should be a simple find-and-replace operation across the source files.
Thank you for maintaining this package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions