0
Why don’t these interpolations work and how to make them:
class Foo {
const BAR = "baz";
}
define("TAZ", "qux");
echo "Foo::BAR={Foo::BAR} TAZ={TAZ}"; //Foo::BAR={Foo::BAR} TAZ={TAZ}
echo "Foo::BAR=${Foo::BAR} TAZ=${TAZ}"; //Foo::BAR= TAZ= e 2 NOTICE Undefined variable
echo "Foo::BAR={${Foo::BAR}} TAZ={${TAZ}}"; //Foo::BAR= TAZ= e 2 NOTICE Undefined variable
//Esperado:
echo "Foo::BAR=".Foo::BAR." TAZ=".TAZ; //Foo::BAR=baz TAZ=qux
Related or duplicate: how to print a constant in the middle of a string, without concatenating?
– Wallace Maxters
@Wallacemaxters, how strange, seeking on the subject, neither your question nor the answers
– Costamilam
It’s more normal than you think, William. The system leaves something to be desired in the polls.
– Wallace Maxters