Using (variable variables) in strings is deprecated, use {} instead

Description

The interpolation syntax is deprecated. It takes an expression (here, a concatenation) to build the name of the variable that is used in the end. It is recommended to update the syntax with a compatible one or use concatenation, before the syntax is removed.

Example

<?php

$foo = 'bar';
var_dump();

?>

Solutions

  • Use {} instead.

  • Use concatenation instead.