On Wed, Jun 1, 2011 at 1:01 PM, Pierre Joye <pierre....@gmail.com> wrote:

> I modified the vote page, pls move your votes to the desired syntax
> (or global -1)

This is a good idea to group things like this.

Back on the soapbox. All of this is just to reduce typing "array" (5
characters) before things?

Old:
$foo = array('a' => 'b', 'c' => 'd');

More than likely new:
$foo = ['a' => 'b', 'c' => 'd'];

5 character difference for each array being saved. That's it. At the
expense of syntax highlighters, IDEs, books, all becoming outdated and
need to be updated. For a language construct that has been around for
what, 10 years?

Oh, and for anyone desiring a ":" for this new shorthand, why stop at
array shorthand. Why not change this from:
foreach($foo as $key => $val)

To:
foreach($foo as $key: $val)

That would save one character for each array iteration like that.

Also - if we're worried about saving characters and shorthand why not
just remove the "$" language construct? That's a LOT of keystrokes. In
my WordPress install, that's 75,412 characters saved. Versus 6,960
"array(" matches, which would save 34,800 characters.

These were quick examples from a coworker. Just another PHP user who
said "wait why would they make another way to express an array?"

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to