
Possible addition to array syntax in PHP

-
Stefan..I agree totally. Too many ways to do the same thing is just confusing. Do one thing (or one way) and do it well…
-
-
While I still think it’s true that people migrate more towards shorter lines of code, I don’t think PHP necessarily needs the short-hand method which resembles JS. It makes sense for a client-side language, because of filesize and whatnot, but since PHP is optimized on the server-side, it is not as crucial. I agree that while it might help in the short-term, it will make things harder in the long-run, with divergent styles of coding. If I had a vote, I’d vote against it.
-
-
Andrew Ingram says:
Feb 6, 12:46 am
I’m in favour of it for the following reasons:
* It looks neater, I like code that looks neat.
* I’ve used that syntax in other languages and liked it, I see no problem with using syntax from other languages if it works.
* It strengthens the notion of arrays being a fundamental part of the language by taking away the “array” method which I feel clouds the concept.
-
-
I agree with this statement so much so that I’m just going to restate it and leave it as is:
“PHP has this approach, fine, let’s stick with it and not add other ways. We have too many ‘aliases’ already in the language.”
-
-
Sebastia Deutsch says:
Jun 19, 01:37 pm
Hey guys… Keep an eye on ruby – there you have a short syntax for arrays. [1,2,3] would make life lots easier and another alias in the language won’t hurt.
-
-
I totally agree as well – why make two methods to do the same thing? This is one of the problems with the open source community, to be honest. There are just too many versions of everything, most of them with such subtle changes that I can’t figure out why they even bothered. Although it’s cool that everyone gets to contribute, or have an opinion, some people think that their methods are better than everyone else’s, and this is why we have so many hundreds of versions for everything. To split it here is highly unnecessary.
-
-
Is it possible for you to list down the pros and cons of adhering to this over PHP? I guess it is known to everybody that most web working people are into PHP. So, why switch to this?
-
-
Thanks for the really usefully Informations Guys. Greetings from Germany,
Webdesign Agentur
-

Feb 5, 11:50 am
Even though I understand why the people would be for this change, I personally share the opinion of the opposition: It adds confusion for new people and also for people already into PHP. PHP is not the other languages, so I don’t feel we should try to copy the other languages. PHP has this approach, fine, let’s stick with it and not add other ways. We have too many “aliases” already in the language.