Den 2019-10-31 kl. 16:48, skrev Claude Pache:
Le 31 oct. 2019 à 15:59, Theodore Brown <theodor...@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

Hi,

I think that RFC was an example where there was a clear cut case
for removing curly brace array access, but not equally clear on to
remove it for curly brace string access.

In my eyes that RFC would have benefited from having two votes,
but the baby went out with the bathwater so to speak.

r//Björn L

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

Reply via email to