> > I talked about ${} and not {$}. ${} also works, at
> > least in some cases. And it is in the docs. Is this
> > an inconsistency in PHP?
>
> Regarding inconsistency, I've never used ${} for this and don't see any
> docs that mention this syntax for arrays in strings.  The docs do mention
> {$} syntax though.  *shrugs*  Not sure what to think :)
>
> ${} does not work for 3d arrays, {$} does.  Both work for 2d.

Why there are two ${} and {$} ????
See
http://www.php.net/manual/en/language.types.string.php#language.types.string
.parsing
for the examples.

Simple syntax

echo "He drunk some ${beer}s"; // works

Complex Syntax

echo "You can even write {$obj->values[3]->name}";

Don't know why there is a simple syntax for that... ${} if there
is a {$}. This is just to confuse people, like me... There are
some things explained there about ${} problems with more
complex expressions. The docs says, this is why {$} exists...
Huh...

Goba


Reply via email to