Re: [RFC][Under discussion] Deprecate ${} string interpolation

From: Date: Mon, 14 Mar 2022 19:04:35 +0000
Subject: Re: [RFC][Under discussion] Deprecate ${} string interpolation
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-117328@lists.php.net to get a copy of this message
> On Mar 12, 2022, at 5:44 AM, Lynn <kjarli@gmail.com> wrote: > > Variable variables should be removed from PHP asap. It's 2022 and I still > encounter bugs due to this "working" in legacy applications. > On Mar 12, 2022, at 5:48 AM, Kamil Tekiela <tekiela246@gmail.com> wrote: > > +1 on removing variable variables as soon as possible. Variable variables provide functionality[1] that if removed would force major rewrites of PHP applications that were architected in a way that depends on that functionality. And while probably between 90% and 99% of the time when someone uses variable variables there are better alternatives, variable variables make certain code possible that would be impossible without them. So, *assuming* removing variable variables is important enough to break any the existing code that uses it — sourcegraph.com reports[2] 162.2k examples of its use — PHP should at least add a function that would allow getting the variables value by name. Something like get_variable_value_by_name($name) but hopefully with a less verbose name than I used in my example just now. #jmtcw -Mike [1] https://stackoverflow.com/questions/16339658/php-variable-value-from-string <https://stackoverflow.com/questions/16339658/php-variable-value-from-string> [2] https://sourcegraph.com/search?q=context:global+lang:php+%5B%5E:%5C%5C%5D%5C%24%5C%7B%5C%24++count:all&patternType=regexp <https://sourcegraph.com/search?q=context:global+lang:php+[^:\\]\$\{\$++count:all&patternType=regexp>

« previous php.internals (#117328) next »