Re: multiple use

From: Date: Sun, 01 Jun 2008 17:43:14 +0000
Subject: Re: multiple use
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-38060@lists.php.net to get a copy of this message
Hi!
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;
Well, with (im)proper formatting many things can be unreadable, but
use FooBar::In::Some::NameSpace             as foo,
    SomeOther::Cool:Massive::awesome::space as bar,
    And::other:namespace                    as foobar;
doesn't seem unreadable at all to me. Repeating "use" is just clutter which doesn't add anything. And btw not all names are that long - when I actually used namespaces in the code, I found that it'd be much easier if I could chain declarations. Just as it is easier to do $a = array(1,2,3) and not $a = array(); $a[0] = 1; $a[1] = 2; $a[2] = 3;
You are comparing apples and oranges. Do we allow foreach($array as $key => $arrayval as $key2 => $val) ?
What foreach has to do with it? Foreach doesn't allow multiple elements at all. But definitions that do - like const, static, var, etc. - allow commas. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#38060) next »