News for hackers. Stuff that matters.
Re:Avoid PHP trap by randallsquared on Saturday July 05, 2008 @07:04PM (#237391)
If creating a new language that looked like PHP/C/Java/etc, you could use {} for both blocks and arrays (and assoc arrays, like PHP) by making blocks a special case of arrays, conceptually. Then {0; 1; 2; 3;} would be an array of four elements, and as a bonus it would free up [] for something else. :)
Re:Avoid PHP trap by mojuba on Saturday July 05, 2008 @07:10PM (#237395)
Like in C or Perl, OK, but that makes both unreadable for humans rather than for compilers, that's what I'm saying. So the reasons behind PHP's array() construct are not trivial.