1.2.1162. String Interpolation Favorite

This analysis collects the various ways that string interpolation is done inside strings. Until PHP 8.1, there were 4 ways :

<?php

$a = "$variable";
$a = "$object->property";
$a = "$array[index]";

$a = "";
$a = "{$variable}";

$a = "";
?>

1.2.1162.1. Specs

Short name

Structures/StringInterpolationFavorite

Rulesets

All, Preferences

Exakat since

2.3.8

PHP Version

With PHP 8.0 and more recent

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Features

interpolation

Available in

Entreprise Edition, Exakat Cloud