|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-11 14:53 UTC] lstrojny@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 17:00:01 2025 UTC |
Description: ------------ After a year of heavy Javascript coding, my return to PHP has been marked with mixed feelings. One thing bothering me is (what seems to me to be) the cumbersome array syntax of PHP. Javascript has: var arr = [ 'foo', 'bar', 'baz' ... ]; Obviously, PHP supports associative arrays and Javascript coders have to resort their language's Object class for achieve that, so perhaps the JS object syntax works better here: var obj = { 'key':'value', 'otherkey':'otherval' ... }; I have found myself passing arrays to methods on an increasingly frequent basis, and I think that a concise syntax like this would go a long way to increasing readability. What do you guys think?