$foo=['hello' => "Hello"];
echo $foo['hello']; // it works as we are doing in normal way
echo "$foo['hello']"; // it throws T_ENCAPSED_AND_WHITESPACE error when we use same variable double quote
echo $foo[hello]; // Throwing error Use of undefined constant.
echo "$foo[hello]"; // Strange!!! it WORKS because not checking constants are skipped in quotes
I am very surprised in echo "$foo[hello]";
because not checking hello index as constant. Exactly I want to know reason behind this?