Re: [RFC] Deprecate Backtick Operator (V2)
| From: | Claude Pache | Date: | Thu, 31 Oct 2019 15:48:19 +0000 |
| Subject: | Re: [RFC] Deprecate Backtick Operator (V2) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107744@lists.php.net to get a copy of this message | ||
> Le 31 oct. 2019 à 15:59, Theodore Brown <theodorejb@outlook.com> a écrit :
>
> Of course there will always be an infinite number of logical ways to
> structure a program, but this is quite different from having two
> different syntaxes in a language that do exactly the same thing. The
> latter is confusing since it's no longer clear which syntax should be
> used. The same situation existed with the curly brace array/string
> access syntax, which was deprecated in PHP 7.4.
>
Yeah, curly brace string access syntax were deprecated in PHP 7.4, and it was IMO an error. Last
day, I reviewed an old library (PHPMarkdown), whose algorithm (probably directly ported from the
original markdown written in Perl) was not very readable. Replacing all $string{$index} instances
with $string[$index] made it even less readable, because the conventional distinction between string
indexes and array indexes used in that library (and in several others libraries) were lost.
Sorry for the rant. But the message is: Existence of precedent is not an argument, because it may be
a bad precedent.
—Claude