Hi Andrey,

On Fri, Jan 30, 2015 at 6:43 AM, Andrey Andreev <n...@devilix.net> wrote:
>
> Is somebody actually recommending the latter form? I'm surprised that
> it even works ... that should be a syntax error IMO.


Do you mean

echo "${array[$key]}"; // Works

should be errror?
This form is common in shell scripting.

http://tldp.org/LDP/abs/html/parameter-substitution.html

I'm using it regularly. I guess many users expect following forms to work.

 $obj->${array[$key]}; // Syntax error
 $obj->${key}; // E_NOTICE. Does not work

What others expect?

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to