Derick Rethans wrote:

That's the problem - also grep does not know if [] is used for arrays or
stings. That's the same for programmers, it's often not easy to conclude from
context - that's my point.

grep won't, but php -l will.

That's true. But what about "reducing complexity"?

Don't you think it's useful to allow a convention like {} for strings and [] for arrays, so you can be sure what $str{1} means without looking at any context? As Rasmus explained, this can't be enforced, but you still can use a convention in your projects today. I think it's good to increase readability using conventions like that.

I'd not drop anything or break any BC, I'd keep this option because having such a convention is very useful when debugging/reading complex scripts.

I know that it's not much work to replace {} with [] syntax, but this will decrease readability - that's my only problem.


best regards
Andreas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to