I hear a lot of opinions here on the curly braces issue, and while I don't
use them, they're not in the way. I'd say let's keep them in.
> > As far a code readability and obviousness goes, I doubt anybody would
> > guess their way to the $str{5} syntax. If you were new to
> > PHP and you
> > were going to try to guess how you would get a character offset in a
> > string, what would your first guess be?
>
> Well, it wouldn't be [] because I'd guess that's for array access as in
> other
> languages. I probably wouldn't guess at all, but look it up, and be very
> happy to find it was {}. I remember being very, very surprised to find []
> doing double duty, and glad that {} existed as an alternative.
You obviously have no C(++) experience. People with the C-background
consider strings to be arrays of characters, and therefor it makes perfect
sense to use [], just like it makes sense to use [] for strings in C.
I don't see a problem with {} however, and see no reason why it should be
removed. I don't find it disturbing when I have to read someone's code
containing {}, so why remove it and make a lot of people angry? I don't see
the improvement except that certain warm and fuzzy feeling...
Ron
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php