Live data from Hacker News

PHP Short Syntax for Arrays: developers say no.

wiki.php.net

31–40 of 89 posts

Re: PHP Short Syntax for Arrays: developers say no.

#31
post #30
post #28

Earlier quoted context omitted.

It's kind of JSON-wish, so this would make more sense: $bar = [1, 2, 3]; $foo = { 'bar': TRUE, 'baz': 'socks' };

This is more perlish, with the exception of the map delimiter. If you proposed => it would be identical to perl.

Almost, but Perl's => also auto-quotes barewords (and only barewords) on the left hand side, so foo => 23 is identical to "foo" => 23.

Re: PHP Short Syntax for Arrays: developers say no.

#36
post #21
post #16

Why try to make PHP more readable? Just use another language. PHP, like C++, is a big industry dinosaur that can't and won't change. In my opinion, the best think you could do is create a new language which compiles to PHP. I.e. A coffeescript for PHP. You don't have to "vote" and get stupid arguments against; you don't have to be backward compatible; and you only have great programmers in that project since crappy o…

> coffeescript for PHP Make this happen please. I can't think of a more deserving language and it'd make my day job a lot nicer.

Haven't had a chance to check it out, but here's an option:

http://pypi.python.org/pypi/hotpotato

Re: PHP Short Syntax for Arrays: developers say no.

#37
I think the "vote" recorded in the link is from a long time ago. Looking at the php.internals mailing list from today, this is what Rasmus is saying:

"Other than a couple of grumpy old-timers, I think we are in agreement that we should add a short array syntax. Whether we should extend that to also add a short object syntax is a secondary question." (http://news.php.net/php.internals/52597)

Re: PHP Short Syntax for Arrays: developers say no.

#40
post #17

This does not seem reasonable. I mean that literally -- this feels more like a choice driven by culture than by reason. The cons seem nowhere near strong enough to counter the fact that the overwhelming majority of users want this syntax, and have been asking for it for years.

It's like they don't even _want_ to fix the language.
Post reply on HN