Hello Oliver,
Oliver Grätz wrote:
Marcus Boerger schrieb:
Hello Jessie,
that's only one case,go with consts. now try
$x = $y ? foo:bar:baz:stupid;
That's nonsense. If I as a programmer cannot comprehend what it should
mean by looking at it then I shouldn't expect that from the language.
To me, this looks like the constant stupid in the class baz of the
subnamespace (?) bar of the namespace foo and the statement lacks the
third parameter. Or well, should it...? The heck, let's put brackets.
Ah! Now it's clear. And this is the moment where I would expect the
language to understand it, too.
OLLi
Thank you!!! This is exactly what happens with my patch now in this
case, one constant named "foo:bar:baz:stupid" is parsed and a syntax
error is produced because of a missing colon and third argument. So, for
this to be interpreted right, a space must be added after "foo:bar" at
the very least (alternatively, use parentheses). This is simply a side
effect of the implementation, but it can actually be considered a
_feature_, since it promotes code clarity in this instance (again, this
only happens and is only required in this ONE instance).
Regards,
Jessie
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php