The second example will not be analyzed. So, better first :)
Anyway, I prefer to use
echo "Hello" . $world["foo"] . ".\n";
Because itโs easier for me to read.
In addition, there is another way:
$world["foo"] = "Foo World!"; echo "Hello, $world[foo].\n";
There are no attempts to use one or the other. you that you (or your team) like.
source share