I'm using PHP 8.2. I have the following heredoc:
$a = 4;
$b = 2;
$str = <<<EOT
$a + $b = {$a + $b}
EOT;
print $str;
Error:
PHP Parse error: syntax error, unexpected token "+", expecting "->" or "?->" or "["
The error is happening on the + sign inside the curly-braces {$a + $b}. I'm reading that complex variable interpolation is a bit different in PHP 8.2, but I cannot find any examples of how to do math with PHP variables inside a heredoc.
What am I missing?