AW: [PHP-DEV] Re: PDM Meeting Notes
| From: | Matthias Pigulla | Date: | Thu, 24 Nov 2005 09:20:27 +0000 |
| Subject: | AW: [PHP-DEV] Re: PDM Meeting Notes | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-20287@lists.php.net to get a copy of this message | ||
> -----Ursprüngliche Nachricht-----
> Von: Jani Taskinen [mailto:sniper@iki.fi]
> We could start with making it an E_ERR..erm..E_STRICT notice
> if you use {} with arrays or [] with strings. And really separate
> them in PHP 6. But does it make any sense?
At least some people here would appreciate it :)
This would be consistent with what has been advised in the past, and making [] on strings an
E_STRICT is the logical step after deprecating it as of PHP4 and before disallowing it in PHP6.
Maybe there's more code out there incorrectly using [] on strings rather than using {}, but
that doesn't make it more right. And nobody would complain about an E_STRICT.
> Removing {} is ultimately the right thing to do, whatever the
> anti-purists may think.
That is, purism is to have as little different language elements as possible at the cost of
overloading? At least I agree that [] and {} being the same is not pure.
> "{$str{1}}" vs. "{$str[1]}", you decide..
Admittedly this is ugly to read but the same thing on the other side is $var[$x][$y] vs.
$var[$x]{$y}.
Just as checking if there's more code out there using $x[1] or $x{1}, you could check if {} is
used more in string contexts or in standalone expressions (not seriously).
-mp.
Oh, btw: http://en.wikipedia.org/wiki/Linguistic_purism:
"Linguistic purism is the opposition to any changes of a given language, or the desire to undo
some changes the language has undergone in the past." So what do the anti-purists want here?
"Anti-purism: A puristic reaction to a manifestation of purism, directed at the removal of
neologisms originating from a puristic intervention."