Re: multiple use
| From: | Hannes Magnusson | Date: | Sun, 01 Jun 2008 17:30:20 +0000 |
| Subject: | Re: multiple use | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38059@lists.php.net to get a copy of this message | ||
On Sun, Jun 1, 2008 at 7:11 PM, Stanislav Malyshev <stas@zend.com> wrote:
> Hi!
>
>> I find the whole namespace issue complicated enough as it is.
>> "importing" multiple namespaces and "aliasing" various
>> classess/functions all in one line decreases the readability imo.
>
> I must say I fail to understand how it's decreasing readability. Is function
> foo($a, $b, $c) hard to read? Is array(1, 2, 3) hard to read? Is global $a,
> $b, $c hard to read? is implements Foo, Bar, Baz hard to read? Is const $a =
> 1, $b = 2 hard to read? What exactly is hard in it?
use FooBar::In::Some::NameSpace as foo,
SomeOther::Cool:Massive::awesome::space as bar, And::other:namespace
as foobar;
vs
use FooBar::In::Some::NameSpace as foo;
use SomeOther::Cool:Massive::awesome::space as bar;
use And::other:namespace as foobar;
> Almost all structures in PHP that allow multiple elements allow definitions
> chained with , - const, var, static, etc. What makes this one so special
> that it becomes unreadable one it has comma in it?
You are comparing apples and oranges. Do we allow foreach($array as
$key => $arrayval as $key2 => $val) ?
-Hannes