<?php
$var = '42';
echo "the answer is $var\n";//you don't need the {}, it's just a scalar type
$ar = ['answer' => 42];
//it's an array, no you do need the {}
echo "the answer is {$ar['answer']}\n";
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
the answer is 42
the answer is 42