Re: [RFC] Deprecate Backtick Operator (V2)

From: Date: Sat, 05 Oct 2019 09:07:56 +0000
Subject: Re: [RFC] Deprecate Backtick Operator (V2)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-107376@lists.php.net to get a copy of this message
> On 5 Oct 2019, at 11:34, Stanislav Malyshev <smalyshev@gmail.com> wrote: > > Hi! > >> https://wiki.php.net/rfc/deprecate-backtick-operator-v2 > > Reading the justifications, I must say I do not find them very > convincing. Specifically: > >> * Alternative functions exist which are more descriptive, easily > understood, and more readily searchable (for example, many common Google > searches omit the “`” token entirely when searching). > > It is very easy to understand `` since it has analogues in other script > languages, also searching for "php backtick" easily leads to PHP manual. > >> Backticks are visually easily confused with single quotes despite > exhibiting radically different behaviour. > > In my font they are not even close. This sounds like calling to stop > using letter O because it looks like 0. Maybe if it's a problem - use > one of the many available programmer's fonts which solve such problems > easily. > >> It could be considered unintuitive that single quoted strings do not > support variable substitution, but single backticks do. > > This sounds like a non-sequitur - why a different syntactic construct > would behave exactly like single quote? > >> It could be considered unintuitive that backticks already rely on the > safe-mode and disabled-function settings for shell_exec > > Safe mode is dead, so I don't think it makes sense to address this. > > In general, the justifications look a bit thin, and very far from > passing the bar that is necessary to justify BC break. Please note that > "you have to read the manual to know all the options for a function" is > not something unacceptable and certainly not grounds for removing the > function. > > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Hi Stas, all, I’m not overly for or against this change - I can see arguments both ways, but please keep in mind that the “other languages” argument works both ways: In php, shell/similar, ruby and perl, backticks are command substitution. This surely due to shared influence. In plenty of other languages they do very different things, from string literals, to interpolation/templates, escaping, identifier quoting, or even comments. Like I said, I can see arguments both ways, but use as a command substitution operator is hardly a universal thing. Cheers Stephen

« previous php.internals (#107376) next »